24.04.2011, 20:47
Sup guys!
I'm trying to make a function that checks if there's Letters in a string, cause in my Dialog, I only accept number 0~9.
But I'm getting these errors:
I'm trying to make a function that checks if there's Letters in a string, cause in my Dialog, I only accept number 0~9.
pawn Код:
stock onlyNumbers(string[])
{
new bool:contains = false;
for(new c = 0; c < sizeof(string); c++)
{
new character = strval(string(c));
if(character >= '0' && character <= '9')
{
// do nothing
}
else
{
contains = true;
return false;
break;
}
}
if(!contains) return true;
}
Код:
C:\Users\Gustavo\Desktop\samp03csvr_R2-2_win32\gamemodes\fcrp.pwn(1551) : warning 224: indeterminate array size in "sizeof" expression (symbol "") C:\Users\Gustavo\Desktop\samp03csvr_R2-2_win32\gamemodes\fcrp.pwn(1553) : error 012: invalid function call, not a valid address C:\Users\Gustavo\Desktop\samp03csvr_R2-2_win32\gamemodes\fcrp.pwn(1553) : warning 215: expression has no effect C:\Users\Gustavo\Desktop\samp03csvr_R2-2_win32\gamemodes\fcrp.pwn(1553) : error 001: expected token: ";", but found ")" C:\Users\Gustavo\Desktop\samp03csvr_R2-2_win32\gamemodes\fcrp.pwn(1553) : error 029: invalid expression, assumed zero C:\Users\Gustavo\Desktop\samp03csvr_R2-2_win32\gamemodes\fcrp.pwn(1553) : fatal error 107: too many error messages on one line

