SA-MP Forums Archive
What wrong code? [HELP REP+] - 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: What wrong code? [HELP REP+] (/showthread.php?tid=540343)



What wrong code? [HELP REP+] - MasonSFW - 04.10.2014

When i click use items nothing happen

My command
pawn Код:
CMD:inventory(playerid, params[])
{
       ShowInventory(playerid);
       return 1;
}
My code
pawn Код:
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));
    }
    format(gItemList,sizeof(gItemList),"%s",gItemList);
    ShowPlayerDialog(playerid,INV_DIALOG_ID,DIALOG_STYLE_LIST,"Your Inventory",gItemList,"Select","Close");
    SetPVarInt(playerid,"PUSINGDIALOG",1);
}
pawn Код:
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);
    else SetPVarInt(playerid,"PUSINGDIALOG",0);
    return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(IsPlayerNPC(playerid)) return 1;
    InventoryOnDialogResponse(playerid, dialogid, response, inputtext);
    return 1;
}



Re: What wrong code? [HELP REP+] - MasonSFW - 04.10.2014

anyone?


Re: What wrong code? [HELP REP+] - MasonSFW - 04.10.2014

No one?