Unable to give items
#1

So, I can give every item except for Xanax, any idea why?
PHP код:
CMD:give(playeridparams[])
{
    new 
playeramountitem[128], str[128];
    if(
sscanf(params"usi"playeritemamount)) return SendClientMessage(playeridCOLOR_GRAY"/give [playerid] [item] [quantity]");
    {
        if(
amount <= 0) return SendErrorMessage(playerid"Invalid amount.");
        if(
player == playerid) return SendErrorMessage(playerid"Invalid Player");
        if(
IsInRangeOfPlayer(playeridplayer5))
        {
            if(!
strcmp(item"VehicleRadio"true))
            {
                if(
Inventory[playerid][VehicleRadio] >= amount)
                {
                    
TakeInventoryItem(playeridVRADIOamount);
                    
GiveInventoryItem(playerVRADIOamount);
                }
                else 
SendErrorMessage(playerid"You don't have this item.");
                return 
1;
            }
            else if(!
strcmp(item"Weapon"true))
            {
            }
            else if(!
strcmp(item"Screwdriver"true))
            {
                if(
Inventory[playerid][Screwdriver] >= amount)
                {
                    
TakeInventoryItem(playeridSCREWDRIVERamount);
                    
GiveInventoryItem(playerSCREWDRIVERamount);
                }
                else 
SendErrorMessage(playerid"You don't have this item.");
                }
                else if(!
strcmp(item"Marijuana"true))
            {
                if(
Inventory[playerid][Marijuana] >= amount)
                {
                    
TakeInventoryItem(playeridMARIJUANAamount);
                    
format(strsizeof(str), "%s passes Marijuana to %s. "GetRoleplayName(playerid), GetRoleplayName(player));
                    
SetPlayerChatBubble(playeridstrCOLOR_RPRange_Short7000);
                    
GiveInventoryItem(playerMARIJUANAamount);
                }
                    else if(!
strcmp(item"Xanax"true))
            {
                if(
Inventory[playerid][Xanax] >= amount)
                {
                    
TakeInventoryItem(playeridXANAXamount);
                    
format(strsizeof(str), "%s passes Xanax to %s. "GetRoleplayName(playerid), GetRoleplayName(player));
                    
SetPlayerChatBubble(playeridstrCOLOR_RPRange_Short7000);
                    
GiveInventoryItem(playerXANAXamount);
                }
                else 
SendErrorMessage(playerid"You don't have this item.");
                return 
1;
                }
            }
        }
        else 
SendErrorMessage(playerid"You are too far away from this player.");
    }
    return 
1;

Reply


Messages In This Thread
Unable to give items - by aoky - 03.07.2017, 21:20
Re: Unable to give items - by Freedom. - 03.07.2017, 21:25
Re: Unable to give items - by saffierr - 03.07.2017, 21:53
Re: Unable to give items - by Meller - 03.07.2017, 23:03

Forum Jump:


Users browsing this thread: 1 Guest(s)