How to select playerid in DIALOG_STYLE_IMPUT
#1

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 ?
Reply
#2

same as in commands, where string/params is inputtext
Reply
#3

String and params might help you.

EDIT ^ seconds different.
Reply
#4

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")
Reply
#5

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.
Reply
#6

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

"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);
Reply
#8

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)