SA-MP Forums Archive
Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem (/showthread.php?tid=539610)



What wrong code ? - MasonSFW - 29.09.2014

Hello i has modified this code it don't work !
Find bug and check it please...

original Link


pawn Код:
#define INV_DIALOG_ID 13337

stock ShowInventory(playerid)
{
    gItemList="";
    for(new item;item<MAX_ITEMS;item++)
    {
        if(!strlen(_GetItemNamePVar(playerid,item))||!_GetItemAmountPVar(playerid,item))continue;
        format(gItemList,sizeof(gItemList),"%s\n%s (%d)",gItemList, _GetItemNamePVar(playerid,item), _GetItemAmountPVar(playerid,item)); //modified
    }
    format(gItemList,sizeof(gItemList),"%s",gItemList);
    ShowPlayerDialog(playerid, INV_DIALOG_ID,DIALOG_STYLE_LIST, "Your Inventory", gItemList, "Select", "Close"); //modified
    SetPVarInt(playerid,"PUSINGDIALOG",1);
}

InventoryOnDialogResponse(playerid, dialogid, response, inputtext[])
{
    if(dialogid != INV_DIALOG_ID) return 1;
    if(!GetPVarInt(playerid, "PUSINGDIALOG")) return 1;
    if(!response) return 1;
    if(!strcmp(inputtext, "Amount", true, 6))
    {
        ShowInventory(playerid);
        return 1;
    }
    format(gItemList, MAX_ITEM_NAME, inputtext[strfind(inputtext,"\t") +2]);
    if(CallLocalFunction("OnPlayerUseItem", "is", playerid, gItemList)) SaveInventory(playerid); //modified
    else SetPVarInt(playerid,"PUSINGDIALOG",0);
    return 1;
}
When i click use items in Dialog is not working .

Why it don't work ?
Sorry my bad english


Re: Problem - [CG]Milito - 29.09.2014

It's ALOT of code, atleast tell us what is not working. Don't expect us to read all that code.


Re: Problem - MasonSFW - 29.09.2014

Up, Help please


Re: Problem - ThePhenix - 29.09.2014

Quote:
Originally Posted by MasonSFW
Посмотреть сообщение
Up, Help please
How are you even expecting us to help you, when the only thing we know about this, is that you are experiencing a "problem".
Learn to be more specific.


Re: Problem - MasonSFW - 29.09.2014

Help please


Re: Problem - Stinged - 29.09.2014

Quote:
Originally Posted by MasonSFW
Посмотреть сообщение
Help please
Didn't you read the replies?
They already told you to be more specific...