Quote:
Originally Posted by ThePhenix
You can do it using an input dialog, and check if the inputtext is numeric, after this check you can perform a second check to know if the ID entered was valid or not.
PHP код:
http://wiki.sa-mp.com/wiki/ShowPlayerDialog
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 0;
}
I don't know who made this function, but here it is:
PHP код:
IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}
|
So, bassicly I'm supposed to do:
pawn Код:
if(!IsNumeric(inputtext)) ...... ?