That's my code:
Код:
stock ShowItems(playerid)
{
new query[128], row[128], data, string[2560], licznik, i;
format(query, sizeof(query), "SELECT MAX(uid) FROM mis_items");
mysql_query(query);
mysql_store_result();
mysql_fetch_row(row);
sscanf(row, "p<|>d", data);
mysql_free_result();
for(i = 0; i <= data; i++)
{
format(query, sizeof(query), "SELECT name, uid, type, value FROM mis_items WHERE uid='%i' AND owner='%s'", i, PlayerInfo[playerid][Nick]);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() == 1)
{
mysql_fetch_row(row);
sscanf(row, "p<|>s[64]ddd", PlayerItems[i][Name], PlayerItems[i][UID], PlayerItems[i][Type], PlayerItems[i][Value]);
format(string, sizeof(string), "%s\n%s [%i][%i]", string, PlayerItems[i][Name], PlayerItems[i][Type], PlayerItems[i][Value]);
DialogItemsID[playerid][i] = i;
i++;
}
licznik++;
mysql_free_result();
}
if(licznik > 0)
{
ShowPlayerDialog(playerid, D_ITEMS, DIALOG_STYLE_LIST, "Przedmioty", string, "Użyj", "Zamknij");
}
else
{
GameTextForPlayer(playerid, "Ta postac nie ma przedmiotow.", 2000, 1);
}
return 1;
}
GameTextForPlayer(playerid, "Ta postac nie ma przedmiotow.", 2000, 1); (GameTextForPlayer(playerid, "You don't have any items.", 2000, 1);
I have to get Items UID from this:
Код:
if(dialogid == D_ITEMS)
{
if(response == 1)
{
//I would like to see the name of the object that the player chose to dialog.
}
}