giveitem doesnt work
#1

Hello guys,

I got this command:

pawn Код:
CMD:giveitem(playerid,params[])
{
    if(pInfo[playerid][pAdminLevel] >= 6)
    {
        if(IsPlayerConnected(playerid))
        {
            new targetid,string[64],amount;
            if(sscanf(params, "is[64]", targetid,amount,string)) return SendClientMessage(playerid,-1,""chat" /giveitem [id] [amount] [item name]");
            if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online");
            {
                AddSlotToInventoryWorld(targetid,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;
}
i get no compiling errors but in game does this:

It should say Owner Voxel has given you [amount] [item name]

and under in this picture i typed /giveitem 0 1 Test
but it didnt give me 1 test but 49 or something..
Reply
#2

pawn Код:
CMD:giveitem(playerid,params[])
{
    if(pInfo[playerid][pAdminLevel] >= 6)
    {
        new targetid,amount,string[64];
        if(sscanf(params, "ris[64]", targetid,amount,string)) return SendClientMessage(playerid,-1,""chat" /giveitem [id] [amount] [item name]");
        if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online");
        AddSlotToInventoryWorld(targetid,string,amount);
        new str[144];
        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;
}
Reply
#3

Can we see the rest of the code please? "AddSlotToInventoryWorld"
We cant help with anything until we see that
Reply
#4

Thank you! that worked konstantino
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)