Dialog age help - 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: Dialog age help (
/showthread.php?tid=408905)
Dialog age help -
Noles2197 - 19.01.2013
I want to make it where when the player types in their age below, it would get what they put so I can save it into their pAge stats. Help appreciated!
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 7)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid,8,DIALOG_STYLE_INPUT,"Registration","Type your age below","Continue","");
if (!response) return Kick(playerid);
PlayerInfo[playerid][pSex]=1;
}
case 1:
{
ShowPlayerDialog(playerid,8,DIALOG_STYLE_INPUT,"Registration","Type your age below","Continue","");
if (!response) return Kick(playerid);
PlayerInfo[playerid][pSex]=2;
}
}
}
}
PHP код:
if(dialogid == 8)
{
PlayerInfo[playerid][pAge]=
}
Re: Dialog age help -
mineralo - 19.01.2013
PHP код:
if(dialogid == 8)
{
PlayerInfo[playerid][pAge]= strval(inputtext);
}
Re: Dialog age help -
Noles2197 - 19.01.2013
Thanks, but I have one more question. How do I make it where they can only set their age through ages 18-65?
Maybe something like this:
PHP код:
if(age < 18 || age > 65)
Re: Dialog age help -
Vince - 19.01.2013
pawn Код:
new age = strval(inputtext);
if(!(18 <= age <= 65))
{
// Error
}
else
{
PlayerInfo[playerid][pAge] = age;
}
Re: Dialog age help -
mineralo - 19.01.2013
PHP код:
if(dialogid == 8)
{
new age = strval(inputtext);
if(age < 18 || age > 65) return ShowPlayerDialog(playerid,8,DIALOG_STYLE_INPUT,"Registration","Type your age below","Continue","");
PlayerInfo[playerid][pAge]= age;
}