24.04.2011, 20:53
You could simply use the stock IsNumeric, to determine if the string is completely numeric, if it returns false, there are characters or letters in it.
Usage;
if(!IsNumeric(string))
EDIT: Beaten twice in a row, both of you good job. I seriously need to refresh before posting.
Usage;
if(!IsNumeric(string))
pawn Код:
stock IsNumeric(str[])
{
new ch, i;
while ((ch = str[i++])) if (ch < '0' || ch > '9') return 0;
return 1;
}

