Nizej kod, ktory banuje po IP
#define PLUGINNAME "Don't say IPs 4 AMXBANS" #define VERSION "0.1" #define AUTHOR "JGHG" #include <amxmodx> #include <regex> #define PATTERN "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" // \b new const powod[] = "Reklama serwerow" new const bantime = 600 new Regex:g_result new g_returnvalue new g_error[64] new g_allArgs[1024] public plugin_modules() require_module("regex") public hook_say(id, level, cid) { read_args(g_allArgs, 1023) g_result = regex_match(g_allArgs, PATTERN, g_returnvalue, g_error, 63) switch (g_result) { case REGEX_MATCH_FAIL, REGEX_PATTERN_FAIL, REGEX_NO_MATCH: return PLUGIN_CONTINUE default: { new ip[19] get_user_ip(id, ip, 18,1) server_cmd("amx_banip ^"%d^" ^"%s^" ^"%s^"",bantime,ip,powod) regex_free(g_result) return PLUGIN_HANDLED } } return PLUGIN_CONTINUE } public plugin_init() { register_plugin(PLUGINNAME, VERSION, AUTHOR) register_clcmd("say", "hook_say") register_dictionary("admincmd.txt") }
A w zalaczniku czysty plugin, jakby byl potrzebny.