15.03.2011, 20:01
pawn Код:
stock IsNumeric(const string[]) {
new length=strlen(string);
if (length==0) return false;
for (new i = 0; i < length; i++) {
if (
(string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+')
|| (string[i]=='-' && i!=0) //
|| (string[i]=='+' && i!=0) //
) return false;
}
if (length==1 && (string[0]=='-' || string[0]=='+')) return false;
return true;
}
public OnPlayerText(playerid, text[])
{
new string[200];
format(string,sizeof(string),"%s",text);
if(IsNumeric(string))
{
return 0;
}
SendPlayerMessageToAll(playerid, string);
return 0;
}