30.12.2013, 01:22
This is command for show items.
/p [find/list]
What's wrong?
/p [find/list]
Код:
error 047: array sizes do not match, or destination array is too small warning 219: local variable "idx" shadows a variable at a preceding level
Код:
if(!strcmp(cmdtext, "/p", true))
{
new idx,option[128];
option = strtok(cmdtext, idx);
if(!strlen(option))
{
SendClientMessage(playerid, -1, "Użyj: /p [szukaj/lista].");
}
else if(strcmp(option,"szukaj",true) == 0)
{
}
else if(strcmp(option,"lista",true) == 0)
{
new dialog[512];
new idx, item, amount;
while(GetPlayerItems(playerid, idx, item, amount))
{
format(dialog, 512, "%s%d x %s (ID:%d)\n", dialog, amount, GetItemName(item), item);
}
ShowPlayerDialog(playerid, DIALOG_ITEMSGUI, DIALOG_STYLE_LIST, "Przedmioty", dialog, "Wybierz", "Zamknij");
}
else
{
SendClientMessage(playerid, -1, "Niepoprawna opcja."); //bad option msg
}
return 1;
}


