Listitem.
#1

Hi. At the outset I would like to apologize for my broken English. I want to my own inventory system, but I have problem which I can not deal with it. How to get paramters from DIALOG_STYLE_LIST? I want to make my own inventory system. Thanks.
Reply
#2

Parameters from listitem? Can you explain that a bit? What do you want to do with these parameters?
Reply
#3

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.
		}
	}
Reply
#4

Код:
if(listitem == 1)
Reply
#5

Quote:
Originally Posted by -Luis
Посмотреть сообщение
Код:
if(listitem == 1)
Sequence each time may be different.
Reply
#6

Buffer it somehow then, with SetPVarString or a global variable for example.
Reply
#7

Listitem == 0 { this your first item } so on
Reply
#8

Quote:
Originally Posted by MagicznyKacper
Посмотреть сообщение
Sequence each time may be different.
I know that, and surley he knows that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)