SA-MP Forums Archive
How to inventory system - 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: How to inventory system (/showthread.php?tid=660550)



How to inventory system - qtg990 - 06.11.2018

Hi
Dialog Inventory system today make
Total inventory items 19

When the item is more than 1, it is displayed in the dialog

But there was a problem.

When you click on the item that you have in total 19 items, the strange item is clicked

example

new item[MAX_ITEM][MAX_PLAYERS];
for(new i=0; i<MAX_ITEM; i++)
{
if(item[i][playerid] > 0)
{
format(str,sizeof(str),"item%s",itemname
ShowDialog...
}

Ondialog function

I have item is slot 3(item[3][playerid])
then dialog show list one

one listitem click is diffrent item slot ...
How my item slot is dialog listitem same??

Please help me

Sorry my bad english..


Re: How to inventory system - TheToretto - 06.11.2018

pawn Code:
new item[MAX_ITEM][playerid];
Should be

pawn Code:
new item[MAX_ITEM][MAX_PLAYERS];
And the ShowPlayerDialog should be after the loop, not inside, use strcat inside the loop after the format.


Re: How to inventory system - qtg990 - 06.11.2018

Yes my source is MAX_PLAYERS
my mistake
how to item slot = listitem?

Example

I have a item slot 6(19 of 1 have item)
show dialog 1 list
list click item slot 0 check..

I want have item slot is dialog listitem same slot


Re: How to inventory system - TheToretto - 06.11.2018

pawn Code:
switch(listitem)
{
    case 0..sizeof(item):
    {

        format(str, sizeof(str), "You've chosen the item %s", item[listitem]);
        SendClientMessage(playerid, -1, str);
    }
}



Re: How to inventory system - qtg990 - 06.11.2018

this source not ..
i have a item 6 slot

then dialog list i have a item list
So i have a one item -> dialog item show 1 list

I want 6 slot item click is dialog
but now source dialog click 0 slot item..
Why problem...