28.03.2019, 12:42
(
Last edited by SaiyanZ; 28/03/2019 at 01:13 PM.
)
So i made this: [it shows the correct list, i just need some ideas to make the dialog response work]
but i don't really know how to detect which item is 'slot' the player is choosing
PHP Code:
CMD:inv(playerid, params[])
{
new string[1000];
new Pname[MAX_PLAYER_NAME];
slotsused[playerid]=0;
for(new i; i<41; i++)
{
if(PlayerItems[playerid][i] > 0)
{
GetPlayerName(i, Pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "{FFFFFF}%s\t%d\n%s", GetItemName(i), PlayerItems[playerid][i], string);
ShowPlayerDialog(playerid, 5024, DIALOG_STYLE_TABLIST, "Your Inventory", string, "Okay","");
slotsused[playerid]++;
}
}
if(slotsused[playerid]==0) return ShowPlayerDialog(playerid, 5022, DIALOG_STYLE_MSGBOX, "Your Inventory", "Your inventory is empty", "Okay","");
return 1;
}
PHP Code:
if(dialogid == 5024)
{
if(response)
{
for(new i; i < slotsused[playerid]; i++)
{
if(listitem == i)
{
}
}
}
}