How to disable numbers?
#2

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;
}
Reply


Messages In This Thread
How to disable numbers? - by GBLTeam - 15.03.2011, 18:15
Re: How to disable numbers? - by blackwave - 15.03.2011, 20:01
Re: How to disable numbers? - by Marricio - 15.03.2011, 20:03
Re: How to disable numbers? - by blackwave - 15.03.2011, 20:05
Re: How to disable numbers? - by admantis - 15.03.2011, 20:07
Re: How to disable numbers? - by GBLTeam - 15.03.2011, 23:01
Re: How to disable numbers? - by GBLTeam - 15.03.2011, 23:43
Re: How to disable numbers? - by Marricio - 16.03.2011, 00:28
Re: How to disable numbers? - by GBLTeam - 16.03.2011, 09:02

Forum Jump:


Users browsing this thread: 1 Guest(s)