#include amxmodx #define PLUGIN "bad and long name kicker" #define VERSION "2014-01-05" #define AUTHOR "author unknown anonym" #define NAMES 100 #define BAD_NAMES_FILE "addons/amxmodx/configs/BadNamesKicker.ini" static NAMES_LIST[2][NAMES][32], Count, names_cvars[1] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) names_cvars[0] = register_cvar("player_names_length","21") } public plugin_cfg() { static file, buffer[525] file = fopen(BAD_NAMES_FILE,"rt") while(!feof(file)) { fgets(file, buffer, 524) trim(buffer) strtok(buffer, NAMES_LIST[0][Count], charsmax(NAMES_LIST[][]), NAMES_LIST[1][Count], charsmax(NAMES_LIST[][]), ';') Count++ } fclose(file) } public client_connect(id) { static name[32], userid, length get_user_name(id, name, 31) userid = get_user_userid(id) length = get_pcvar_num(names_cvars[0]) for(new m = 0; m length) { name[length] = '^0' server_cmd("kick #%d ^"Your name is too long, max length: %d^"", userid, length) } }