strfind numbers
#3

A string is nothing more than an array filled with ASCII-character codes for each letter. Instead of using strfind for every number, you can do something like this:
Код:
for (new c; c < sizeof(name); c++)
{
    if ('0' <= name[c] <= '9') return Kick(playerid);
}
Note that '0' and '9' are NOT numbers, but ASCII characters. What happens here is that the script checks if the ASCII code of name[c] (a character in your name) is between the ASCII number of '0' (which is 48 ) and the ASCII number of '9' (which is 57). So if any of the name's characters is between those ASCII characters in the list, it will kick the player. The full ASCII list can be found here.
Reply


Messages In This Thread
strfind numbers - by Lidor124 - 11.06.2014, 15:32
Re: strfind numbers - by MattTucker - 11.06.2014, 16:52
Re: strfind numbers - by Basssiiie - 11.06.2014, 17:59
Re: strfind numbers - by Lidor124 - 13.06.2014, 06:16

Forum Jump:


Users browsing this thread: 2 Guest(s)