2 Questions about DIALOG_STYLE_INPUT
#1

1st Question :
How can I know what the player typed in
the DIALOG_STYLE_INPUT when he response
in it, and how can I save what he wrote (DINI)

2nd Question :
How can I make sure that the player typed
5 or more characters.

Thanks.
Reply
#2

When you create a dialog with the input style, what he types will be stored in the inputtext[] in the dialog callback. Then it's simple:

pawn Код:
if(dialogid == ?)
{
if(strlen(inputtext) >= 5)
{
dini_Set(file,"Example",inputtext);
}}
Reply
#3

Quote:
Originally Posted by Desert
When you create a dialog with the input style, what he types will be stored in the inputtext[] in the dialog callback. Then it's simple:

pawn Код:
if(dialogid == ?)
{
if(strlen(inputtext) >= 5)
{
dini_Set(file,"Example",inputtext);
}}
Okay, thanks for that but how can I make the player only
type a specific word. Lets say Male or Female, and if he didn't
type Male or Female he will get an error message.
Reply
#4

pawn Код:
if(strcmp(inputtext, "Male", true) == 0)
{

}
else if(strcmp(inputtext, "Female", true) == 0)
{

}
else
{
// Error message
}
Reply
#5

Quote:
Originally Posted by MadeMan
pawn Код:
if(strcmp(inputtext, "Male", true) == 0)
{

}
else if(strcmp(inputtext, "Female", true) == 0)
{

}
else
{
// Error message
}
Oh, okay thanks
Reply
#6

Okay, sorry for the double post
but how can I know this time
if the player didn't type a number
or IsNumeric so that I can send
another error message to the player.

Thanks.
Reply
#7

pawn Код:
if(IsNumeric(inputtext)) return SendClientMessage(playerid, color, "Error: No numbers!)!)1010101"); // his message WAS numeric
if(!IsNumeric(inputtext)) return SendClientMessage(playerid, color, "3RR0R: N0 L3773R5!!!1011!11"); // his message WAS NOT numeric
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)