Help to fix code
#1

I do not know exactly what the problem is, but seeing all sorts of lessons, I think the problem in check
All code written with 0
Code:

Код:
if(!strcmp(inputtext[0],"Пицца",true))
{
    RemoveItem(playerid,"Пицца",1);
    SendClientMessage(playerid, COLOR_WHITE, "Вы выкинули пиццу!");
}
RemoveItem is with include j_inventory
but the function itself looks like this:

Код:
stock RemoveItem(playerid,ItemName[],Amount)
{
    for(new item;item<MAX_ITEMS;item++)
    {
        if(!_GetItemAmountPVar(playerid,item))continue;
        if(!strcmp(_GetItemNamePVar(playerid,item),ItemName,true))
        {
            _SetItemAmountPVar(playerid,item,_GetItemAmountPVar(playerid,item)-Amount);
            if(_GetItemAmountPVar(playerid,item)<=0)_SetItemAmountPVar(playerid,item,0);
            if(_GetItemAmountPVar(playerid,item)>MAX_ITEM_STACK)
            {
                _SetItemAmountPVar(playerid,item,MAX_ITEM_STACK);
                return 2;
            }
            return 1;
        }
    }
    return 0;
}
The lesson should be checking

Код:
if(!strcmp(ItemName,"Пицца",true))
But my code is located in public OnDialogResponse
What to do?
Reply


Messages In This Thread
Help to fix code - by kronka - 15.07.2017, 20:57
Re: Help to fix code - by LennyBE - 15.07.2017, 21:05
Re: Help to fix code - by kronka - 16.07.2017, 07:32

Forum Jump:


Users browsing this thread: 1 Guest(s)