Raised This Month: $ Target: $400
 0% 

Invalid Character in Name


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
owned
Member
Join Date: Jul 2007
Old 12-24-2007 , 17:45   Invalid Character in Name
Reply With Quote #1

What i'm trying to do is, if the user has ` or ~ in their name it kicks them with a message.

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Bad Name Kicker"
#define VERSION "1.0"
#define AUTHOR "owned"

new const bad_names[][] = {"`","~"};


public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_connect(id){
    new 
name[32];
    
get_user_name(id,name,31);
    
    
checkname(id);
    return 
PLUGIN_CONTINUE;
}

public 
client_infochanged(id){
    new 
name[32];
    
get_user_name(id,name,31);
    
    
checkname(id);
    return 
PLUGIN_CONTINUE;
}

public 
checkname(id){
    new 
name[32];
    
get_user_name(id,name,31);
    new 
uid get_user_userid(id);
    
    if(
is_user_admin(id)){
        return 
PLUGIN_CONTINUE;
    }else {
        for(new 
0sizeof bad_namesi++){
            if(
contain(name,bad_names[i]) > 0){
                
kickuser(uid);
                return 
PLUGIN_CONTINUE;
            }
        }
    }
    return 
PLUGIN_CONTINUE;
}

public 
kickuser(id){
    new 
name[32];
    
get_user_name(id,name,31);
    
    
server_cmd("banid 1 #%d"id);
    
client_cmd(id"echo ^"[BNKYour name contained invalid characters!^"; disconnect");
    return 
PLUGIN_CONTINUE;

Well I guess it doesn't want to kick me. Can I get some help?
__________________
MARREC/OWNED = me.
owned is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:05.


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