SA-MP Forums Archive
How to select playerid in DIALOG_STYLE_IMPUT - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to select playerid in DIALOG_STYLE_IMPUT (/showthread.php?tid=575153)



How to select playerid in DIALOG_STYLE_IMPUT - SandKing94 - 24.05.2015

I want to create:
Код:
ShowPlayerDialog(playerid,4, DIALOG_STYLE_INPUT, "New faction", "Enter the new faction's Leader:", "Enter", "Cancel");
And then to use the id or the name of the player that i've inputted in the dialog , but how to do it ?


Re: How to select playerid in DIALOG_STYLE_IMPUT - ikey07 - 24.05.2015

same as in commands, where string/params is inputtext


Re: How to select playerid in DIALOG_STYLE_IMPUT - Bingo - 24.05.2015

String and params might help you.

EDIT ^ seconds different.


Re: How to select playerid in DIALOG_STYLE_IMPUT - SandKing94 - 24.05.2015

Quote:
Originally Posted by ikey07
Посмотреть сообщение
same as in commands, where string/params is inputtext
Already tried it and i get errors.
Код:
error 033: array must be indexed (variable "inputtext")



Re: How to select playerid in DIALOG_STYLE_IMPUT - Konstantinos - 24.05.2015

ikey07 already told you how, so post what you've done so far.

Quote:
Originally Posted by SandKing94
Посмотреть сообщение
Already tried it and i get errors.
Код:
error 033: array must be indexed (variable "inputtext")
That could be because you used == to compare the strings instead of strcmp function.


Re: How to select playerid in DIALOG_STYLE_IMPUT - SandKing94 - 24.05.2015

Code:
Код:
format(query,sizeof(query),"SELECT * FROM factions WHERE ID = %d",pInfo[inputtext][Faction]);
Error:
Код:
error 033: array must be indexed (variable "inputtext")



Re: How to select playerid in DIALOG_STYLE_IMPUT - Konstantinos - 24.05.2015

"inputtext" is string not an integer. sscanf can be used:
pawn Код:
new f_id;
if (sscanf(inputtext, "r", f_id)) return // player didn't input a number.
if (f_id == INVALID_PLAYER_ID) return // not connected

..., pInfo[f_id][Faction);



Re: How to select playerid in DIALOG_STYLE_IMPUT - SandKing94 - 24.05.2015

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
"inputtext" is string not an integer. sscanf can be used:
pawn Код:
new f_id;
if (sscanf(inputtext, "r", f_id)) return // player didn't input a number.
if (f_id == INVALID_PLAYER_ID) return // not connected

..., pInfo[f_id][Faction);
Thanks