Jump to content

Question

Posted
CMD:giveitemall(playerid,params[])
{
    if(pInfo[playerid][pAdminLevel] >= 6)
    {
        new string[64], amount;
        if(sscanf(params, "is[64]", amount,string)) return SendClientMessage(playerid,-1,""chat" /giveallitem [amount] [item name] (MAKE SURE IT'S NOT INVALID!)");

        foreach(Player,i)
        {
            AddSlotToInventoryWorld(i,string,amount);
        }

        new str[230];
        format(str,sizeof(str),"*"COL_YELLOW" %s %s has given everyone "COL_WHITE"%i"COL_GREEN" %s",GetAdminName(playerid),PlayerName(playerid), amount, string);
        SendClientMessageToAll(-1,str);
    }
    return 1;

 

Aș dori să fac și o comandă încât să dea item doar la un player. Mi-ar trebui doar o eroare că jucătorul nu este conectat.  Mă puteți ajuta cum?

1 answer to this question

Recommended Posts

  • 0
Posted
CMD:giveitemall(playerid,params[])
{
    if(pInfo[playerid][pAdminLevel] >= 6)
    {
        new string[64], targetid, amount;
        if(sscanf(params, "ius[64]", targetid, amount, string)) return SendClientMessage(playerid,-1,""chat" /giveallitem [playerid/PartOfName] [amount] [item name] (MAKE SURE IT'S NOT INVALID!)");
        AddSlotToInventoryWorld(taregtid,string,amount);
        new str[230];
        format(str,sizeof(str),"*"COL_YELLOW" %s %s has given you "COL_WHITE"%i"COL_GREEN" %s",GetAdminName(playerid),PlayerName(playerid), amount, string);
        SendClientMessage(targetid,-1,str);
    }
    return 1;

Sper sa iti fie de ajutor.

Retras

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.