Check if there are only numbers
#1

Hi everyone,

Maybe this is a nooby question, but how do i check if a player only typed numbers inside a dialog, and if it is between 18 and 80.

I know this is nooby, but i'm stuck.

Thanks
Reply
#2

Ex
pawn Код:
if(strval(inputtext) > 18 && strval(inputtext) < 80)
pawn Код:
IsNumeric(const string[])
{
    for (new i = 0, j = strlen(string); i < j; i++)
        if (string[i] > '9' || string[i] < '0') return 0;

    return 1;
}
Reply
#3

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
Ex
pawn Код:
if(strval(inputtext) > 18 && strval(inputtext) /, 80)
pawn Код:
IsNumeric(const string[])
{
    for (new i = 0, j = strlen(string); i < j; i++)
        if (string[i] > '9' || string[i] < '0') return 0;

    return 1;
}
Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)