AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Check values in names (https://forums.alliedmods.net/showthread.php?t=147013)

Racoon 01-04-2011 08:46

Check values in names
 
How can I detect names, which consist only of digits (0-9) ?

Examples:
890685114333
769008765445
881220806131

Bugsy 01-04-2011 09:03

Re: Check values in names
 
is_str_num

Racoon 01-04-2011 09:07

Re: Check values in names
 
Quote:

Originally Posted by Bugsy (Post 1385801)

thnxxx)))))

Racoon 01-04-2011 13:36

Re: Check values in names
 
Ok, I need to ban fake players with names, which consist of digits. They keep flooding the server via proxies, so it's not possible to ban them all. The code below doesn't work. All players are kicked instead.
PHP Code:

#include <amxmodx>

public plugin_init() 
{
    
register_plugin("Antifake""0.1""Racoon")
}

public 
client_authorized(id)
{
    new 
name[32]
    
read_argv(1,name,31)
    if(!
is_str_num(name))
    {
        
server_cmd("kick #%d ^"F*CK YOUfake Player!^""get_user_userid(id))
    }



Bugsy 01-04-2011 13:58

Re: Check values in names
 
get_user_name( id , name , charsmax( name ) ) instead of read_argv

Also, remove the ! since you want to kick if all digits.

Racoon 01-04-2011 15:53

Re: Check values in names
 
Yeah, works perfect! Thx again :D


All times are GMT -4. The time now is 01:57.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.