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(PLUGIN, VERSION, AUTHOR)
}
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 i = 0; i < sizeof bad_names; i++){
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 ^"[BNK] Your name contained invalid characters!^"; disconnect");
return PLUGIN_CONTINUE;
}
Well I guess it doesn't want to kick me. Can I get some help?
__________________