Retrieve dialog listitem name
#1

Is it possible and if is then how ?
Reply
#2

It is, but not native.
Create a global string for a specific dialog and put the listitem text in it when showing the dialog.
In OnPlayerDialogResponse use a separatorfunction, something to get a single line (element) of the string by its index and you got it. There might be such a function somewhere here in the forum, else it shouldnt be hard to make one yourself.
Reply
#3

Well when you get a response, it gives you the ID of the listitem. If you used an array to build the dialog, use it as an index. If you used static text, make a switch statement based on the id (since its static text, you have to make this part static as well).


If you need me to go more indepth, PM me.
Reply
#4

Solved it by creating:
pawn Code:
new CharName[MAX_PLAYERS][CHARACTERS][32];
When fetching data from MySQL(afterwards putted to dialog):
pawn Code:
CharName[playerid][i] = Field;
i++;
So that i is equal to listitem.
And for data display(it is called under dialog):
pawn Code:
CharName[playerid][listitem];
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)