Tylko zmienić, skompiluje se juz sam
Z góry wielkie dzięki
/* _____ _____ __ _ _ _ |_ _||_ _|[ | / |_ (_) / |_ | | | | | |`| |-'__ _ .--..--. ,--. `| |-'.---. | ' ' | | | | | [ | [ `.-. .-. | `'_ : | | / /__ __/ / | | | |, | | | | | | | | // | |,| |,| __., `.__.' [___]__/[___][___||__||__]'-;__/__/ '.__.' ____ ____ _ __ _______ _ ______ __ |_ || _| (_) [ | |_ __ (_) .' ___ | | ] | |__| | __ .--./)| |--. | |__) |__ _ .--. .--./) / .' _| __ _ ,--. _ .--. .--.| | | __ | [ | / /'`;| .-. | | ___/[ | [ `.-. | / /'`; | | ____[ | | | `'_ : [ `/'`]/ /'`' | _| | | |_ | | ._//| | | | _| |_ | | | | | | ._// `.___] || _/ |,// | |, | | | __/ | |____||____|[___].',__`[___]|__] |_____| [___][___||__].',__` `._____.' '.__.'_/'-;__/[___] '.__.;__] ( ( __)) ( ( __)) __ _____ / | / ___ `. _ __`| | |_/___) | [ [ ]| | .'____.' / /_| |_ _ / /_____ __/|_____|(_)|_______| ______ ___ ____ _ _ |_ _ |_ ||_ _| (_) (_) | |_) | _ __ | |_/ / __ _ .--..--. __ | __'. [ [ ] | __'. [ | [ `.-. .-. | [ | _| |__) | '/ / _| | _ | | | | | | | | | | |_______/[_: / |____||____|[___][___||__||__][___] __.' Author: Kimi Version: 1.2 ==== # *Cvars* # ====================================================================================================================================== - amx_hpk_sound 1/0 - Sound when a player is kicked/banned (1 - default) - amx_hpk_ban 0/1/2 - If it's 0 it will only kick the player, if it's will banIP (default) and if it's 2 will ban the SteamID. - amx_hpk_bantime <minutes> - Ban duration. - amx_max_ping 100 - Max ping. - amx_time_ping 15 - Frequency in seconds of ping checking. - amx_check_ping 5 - Minimal number of checks before doing anything. ========================================================================================================================================================= ==== # *Commands* # =================================================================================================================================== - amx_hpk_sound 1/0 - Activated or Not. - amx_hpk_ban 0/1/2 - Kick method. - amx_hpk_bantime <minutes> - Ban duration. - amx_max_ping <ping> - Max ping. - amx_time_ping <seconds> - Frequency in seconds of ping checking. - amx_check_ping <checks> - Minimal number of checks before doing anything. ========================================================================================================================================================= ==== # *Credits* # ==================================================================================================================================== - hack and more - SAMURAI - alliedmodders' users for critics ========================================================================================================================================================= /| | /| . //| . ///| . ////| .......................................................................................................................................................... */ #include <amxmodx> #include <amxmisc> #define ACCESS ADMIN_RCON stock const PLUGIN_NAME[] = "Ultimate High Ping Guard"; stock const PLUGIN_VERSION[] = "1.1"; stock const PLUGIN_AUTHOR[] = "Kimi"; new MAX_HIGHPING; new TIME_HIGHPING; new CHECK_HIGHPING; new hpksound, hpkban, btime; new iNumTests[33] new gsound[] = {^"vox/buzwarn^"}; public plugin_init() { register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR); // Cvars: register_cvar("amx_show_activity","2") hpksound = register_cvar("amx_hpk_sound","1"); hpkban = register_cvar("amx_hpk_ban","1"); btime = register_cvar("amx_hpk_bantime","10"); MAX_HIGHPING = register_cvar("amx_max_ping","100"); TIME_HIGHPING = register_cvar("amx_time_ping","15"); CHECK_HIGHPING = register_cvar("amx_check_ping","5"); // Multi-langual dictionary: register_dictionary("Ultimate_High_Ping_Guard.txt"); // Commands: register_concmd("amx_hpk_sound","sound_command",ACCESS); register_concmd("amx_hpk_ban","ban_command",ACCESS); register_concmd("amx_hpk_bantime","bantime_command",ACCESS); register_concmd("amx_max_ping","max_ping",ACCESS); register_concmd("amx_time_ping","time_ping",ACCESS); register_concmd("amx_check_ping","check_ping",ACCESS); // Others: if (TIME_HIGHPING < 15) TIME_HIGHPING = 15 if (CHECK_HIGHPING < 5) CHECK_HIGHPING = 5 return PLUGIN_CONTINUE } public client_putinserver(id) { iNumTests[id] = 0 if (!is_user_bot(id)) { new param[1] param[0] = id set_task(25.0, "Warning", id, param, 1) } return PLUGIN_CONTINUE } public Warning(param[]) { if(get_pcvar_num(hpkban) == 1.2) { client_print(param[0], print_chat, "%L",LANG_PLAYER,"Warning_ban", MAX_HIGHPING); set_task(float(TIME_HIGHPING), "checkPing", param[0], param, 1, "b") } else { client_print(param[0], print_chat, "%L",LANG_PLAYER,"Warning_kick", MAX_HIGHPING); set_task(float(TIME_HIGHPING), "checkPing", param[0], param, 1, "b") } } public client_disconnect(id) { remove_task(id) return PLUGIN_CONTINUE } public checkPing(param[]) { new id = param[0] if ((get_user_flags(id) & ADMIN_IMMUNITY) || (get_user_flags(id) & ADMIN_RESERVATION)) { remove_task(id) client_print(id, print_chat, "%L",LANG_PLAYER,"imun_msg") return PLUGIN_CONTINUE } new ping, loss get_user_ping(id, ping, loss) if (ping > MAX_HIGHPING) ++iNumTests[id] else if (iNumTests[id] > 0) --iNumTests[id] if (iNumTests[id] > CHECK_HIGHPING) BanLag(id) return PLUGIN_CONTINUE } BanLag(id) { new ping, loss get_user_ping(id, ping, loss) switch(hpksound) { case 0: { switch(hpkban) { case 0: { new name[32] get_user_name(id, name, 31); new uID = get_user_userid(id); server_cmd("kick #%d ^"High Ping Detected !^"", uID); client_print(0, print_chat, "%L",LANG_PLAYER,"kickmsg", name, btime, ping); } case 1: { new name[32] get_user_name(id, name, 31); //new uID = get_user_userid(id); //new ip = get_user_ip(id, ip,31); server_cmd("amx_banip %s %d ^"High Ping Detected !^"", name, btime); client_print(0, print_chat, "%L",LANG_PLAYER,"banmsg", name, btime, ping); } case 2: { new name[32] get_user_name(id, name, 31); new uID = get_user_userid(id); server_cmd("banid #%d %d ^"High Ping Detected !^"", uID, btime); client_print(0, print_chat, "%L",LANG_PLAYER,"banmsg", name, btime, ping); } } } case 1: { switch(hpkban) { case 0: { new name[32] get_user_name(id, name, 31); new uID = get_user_userid(id); server_cmd("kick #%d ^"High Ping Detected !^"", uID); client_print(0, print_chat, "%L",LANG_PLAYER,"kickmsg", name, btime, ping); client_cmd(0, "spk %d", gsound); } case 1: { new name[32] get_user_name(id, name, 31); //new uID = get_user_userid(id); //new ip = get_user_ip(name,ip,31); server_cmd("amx_banip %s %d ^"High Ping Detected !^"", name, btime); client_print(0, print_chat, "%L",LANG_PLAYER,"banmsg", name, btime, ping); client_cmd(0, "spk %d", gsound) } case 2: { new name[32] get_user_name(id, name, 31); new uID = get_user_userid(id); server_cmd("banid #%d %d ^"High Ping Detected !^"", uID, btime); client_print(0, print_chat, "%L",LANG_PLAYER,"banmsg", name, btime, ping); client_cmd(0, "spk %d", gsound); } } } } return PLUGIN_CONTINUE } public sound_command(id) { if(!(get_user_flags(id) & ACCESS)) return PLUGIN_HANDLED client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd") server_cmd("amx_cvar amx_hpk_ban") return PLUGIN_CONTINUE } public ban_command(id) { if(!(get_user_flags(id) & ACCESS)) return PLUGIN_HANDLED client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd") server_cmd("amx_cvar amx_hpk_ban") return PLUGIN_CONTINUE } public bantime_command(id) { if(!(get_user_flags(id) & ACCESS)) return PLUGIN_HANDLED client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd") server_cmd("amx_cvar amx_hpk_ban") return PLUGIN_CONTINUE } public max_ping(id) { if(!(get_user_flags(id) & ACCESS)) return PLUGIN_HANDLED client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd") server_cmd("amx_cvar amx_max_ping") return PLUGIN_CONTINUE } public time_ping(id) { if(!(get_user_flags(id) & ACCESS)) return PLUGIN_HANDLED client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd") server_cmd("amx_cvar amx_time_ping") return PLUGIN_CONTINUE } public check_ping(id) { if(!(get_user_flags(id) & ACCESS)) return PLUGIN_HANDLED client_print(0,print_chat,"%L",LANG_PLAYER,"change_cmd") server_cmd("amx_cvar amx_check_ping") return PLUGIN_CONTINUE } /* Visit www.cs-utilz.net for other AMXX Plugins ! */