new age;
age = strval(inputtext);
if(age < 80 || age > 7)
{
PlayerInfo[playerid][pAge] = age;
RegistrationStep[playerid] = 3;
HidePlayerDialog(playerid);
ShowPlayerDialog(playerid, 1501, DIALOG_STYLE_LIST, "Where you from?", "{FF0000} - USA\n{37DB45} - Europe\n{15D4ED} - Other", "Ok", "");
}
else
{
HidePlayerDialog(playerid);
ShowPlayerDialog(playerid, 1500, DIALOG_STYLE_INPUT, "Age", "Input the correct age.", "Ok", "");
}
if(strval(inputtext) < 7 || strval(inputtext) > 80) return "you have to put right age message"
if ( strval ( inputtext ) > 80 || strval ( inputtext ) < 7 )
{
HidePlayerDialog(playerid);
ShowPlayerDialog(playerid, 1500, DIALOG_STYLE_INPUT, "Age", "Input the correct age.", "Ok", "");
}
if ( !IsNumeric ( inputtext ) ) return ShowPlayerDialog(playerid, 1500, DIALOG_STYLE_INPUT, "Age", "Input the correct age.", "Ok", "");
PlayerInfo[ playerid ][ pAge ] = strval ( inputtext );
RegistrationStep[ playerid ] = 3;
HidePlayerDialog( playerid );
ShowPlayerDialog(playerid, 1501, DIALOG_STYLE_LIST, "Where you from?", "{FF0000} - USA\n{37DB45} - Europe\n{15D4ED} - Other", "Ok", "");
IsNumeric(const string[])
{
for ( new i = 0, j = strlen ( string ); i < j; i++ )
{
if ( string[ i ] > '9' || string[ i ] < '0') return 0;
}
return 1;
}
new age;
age = strval(inputtext);
if(age < 80 && age > 7)
{
PlayerInfo[playerid][pAge] = age;
RegistrationStep[playerid] = 3;
HidePlayerDialog(playerid);
ShowPlayerDialog(playerid, 1501, DIALOG_STYLE_LIST, "Where you from?", "{FF0000} - USA\n{37DB45} - Europe\n{15D4ED} - Other", "Ok", "");
}
else
{
HidePlayerDialog(playerid);
ShowPlayerDialog(playerid, 1500, DIALOG_STYLE_INPUT, "Age", "Input the correct age.", "Ok", "");
}
use && not ||
pawn Код:
|