#pragma semicolon 1
#pragma ctrlchar '\'
new arr_003[32];
new var_028;
new var_025;
new var_006 = 1;
new var_006 = 1;
new var_022;
new var_023;
new var_005;
new var_022;
new var_007;
new var_003;
new arr_003[32];
new var_003;
new str_176[68];
new var_015;
new var_033;
new var_032;
new var_015;
new var_034;
new var_017 = 3;
new var_016;
new var_015;
new var_016;
new var_018;
new var_023;
new var_023;
new var_008;
new var_016;
new var_015;
new var_016;
func_00(arg_1, arg_2, arg_3, arg_4)
{
return 0 < floatcmp(arg_1, arg_2);
}
func_01(arg_1, arg_2, arg_3)
{
new var3 = 0;
while (arg_1[var3] && isdigit(arg_1[var3]))
{
var3++;
}
new var2;
return arg_1[var3] && var3;
}
func_02(arg_1, arg_2, arg_3, arg_4, arg_5, arg_6)
{
new var1 = 0;
if ((var1 = contain(arg_1, arg_3)) == -1)
{
return 0;
}
new var2 = 0;
new var3;
var3 = strlen(arg_4);
new var4;
var4 = strlen(arg_3) - var3;
new var5;
var5 = strlen(arg_1);
new var6 = 0;
while (replace(arg_1[var1], arg_2 - var1, arg_3, arg_4))
{
var2++;
var1 = var3 + var1;
var5 -= var4;
if (!(var1 >= var5))
{
var6 = contain(arg_1[var1], arg_3);
if (!(var6 == -1))
{
var1 = var6 + var1;
}
return var2;
}
return var2;
}
return var2;
}
func_03(arg_1, arg_2, arg_3, arg_4)
{
return get_localinfo("amxx_configsdir", arg_1, arg_2);
}
public plugin_init()
{
register_plugin("Aliases checker", "1.0.3", "kanagava");
__unk = ArrayCreate(64, 32);
__unk = ArrayCreate(1, 32);
__unk = TrieCreate();
register_srvcmd("ac_add_alias", "alias_add", -1, "ad_add_alias <level> <alias>", 0);
register_srvcmd("ac_set_alias_reason", "alias_add_reason", -1, "ac_set_alias_reason <level> <reason>", 0);
register_srvcmd("ac_set_alias_time", "alias_add_time", -1, "ac_set_alias_time <level> <time>", 0);
register_srvcmd("ac_set_alias_punish", "alias_add_punish", -1, "ac_set_alias_punish <level> <time>", 0);
register_srvcmd("ac_check", "ac_check_client", -1, "ac_check #userid", 0);
register_cvar("ac_logdays", "14", 0, 0);
register_cvar("ac_logs", "1", 0, 0);
register_cvar("ac_check_steams", "1", 0, 0);
register_cvar("ac_recheck_time", "10", 0, 0);
register_cvar("ac_except_slowhack", "0", 0, 0);
register_cvar("ac_check_interval", "1.0", 0, 0);
register_cvar("ac_nocheck", "0", 0, 0);
register_cvar("ac_detect_new", "0", 0, 0);
register_srvcmd("ad_cvar_add", "cvar_add", -1, "ad_cvar_add <level> <flags> <cvar> <min> <max>", 0);
register_srvcmd("ad_cvar_add_warn", "cvar_add_warn", -1, "ad_cvar_add_warn <#userid> <num>", 0);
register_srvcmd("ac_set_cvar_punish", "cvar_add_punish", -1, "ac_set_cvar_punish <level> <punish>", 0);
register_cvar("ad_cvar_max_att", "3", 0, 0);
register_cvar("ad_cvar_max_warns", "3", 0, 0);
register_cvar("ad_cvar_recheck_time", "60", 0, 0);
__unk = ArrayCreate(64, 32);
__unk = ArrayCreate(32, 32);
__unk = ArrayCreate(32, 32);
__unk = ArrayCreate(1, 32);
__unk = ArrayCreate(1, 32);
var_003 = TrieCreate();
var_018 = TrieCreate();
register_clcmd("alias_menu", "alias_menu", arr_001, "- displays ban menu", -1, 0);
register_clcmd("say /alias", "alias_menu", arr_001, var_024, -1, 0);
return 0;
}
public alias_menu(arg_1, arg_2, arg_3)
{
if (get_user_flags(arg_1, 0) & arr_001 || 1)
{
var2 = alias_show_menu(arg_1 + 6975545);
}
else
{
var2 = 1;
}
return var2;
}
public ac_check_client()
{
new var1;
read_argv(1, var1, 9);
trim(var1);
if (var1 == 35)
{
new var2;
var2 = find_player("k", str_to_num(var1 + 4));
if (var2)
{
if (!is_user_bot(var2))
{
console_print(0, "Checking user [%d]", var2);
func_04(var2);
}
}
else
{
console_print(0, "Can't find %s", var1);
}
}
else
{
console_print(0, "use ac_check #userid");
}
return 1;
}
public alias_show_menu(arg_1, arg_2, arg_3)
{
if (is_user_connected(arg_1) && get_user_flags(arg_1, 0) & arr_001)
{
new var3;
new var4;
new var5;
var5 = ArraySize(g_var84);
formatex(var3, 31, "Total Aliases \r%d", var5);
var_025 = menu_create(var3, "menu_handler", 0);
new var6;
new var7 = 0;
new var8 = 0;
get_players(var6, var7, var_026, var_027);
new var9;
new var10;
new var11;
new var12 = 0;
while (var12 < var7)
{
var_028 = var6[var12];
var8 = arr_010[var_028] + 1;
get_user_name(var_028, var9, 31);
new var13 = 0;
if (var5 == var8)
{
var10 = arr_018;
var13 = var8 * arr_002 / var5;
}
else
{
var13 = var8 * arr_002 / var5;
ArrayGetString(g_var84, var8, var10, 63);
}
new var2;
if (var13 == arr_002)
{
var2[0] = "\y";
}
else
{
var2[0] = "\r";
}
formatex(var4, 95, "%s [\y%d\w] (%s%d \wproc.)", var9, var8, var2, var13);
num_to_str(var_028, var11, 2);
menu_additem(var_025, var4, var11, 0, -1);
var12++;
}
menu_setprop(var_025, 4, "Exit", 0);
menu_setprop(var_025, 6, 1);
menu_display(arg_1, var_025, arr_011[arg_1], -1);
new var14;
var14 = arg_1;
var14 + 4 = var_025;
set_task(2,00, "update_menu", arg_1 + -101289152, var14, 2, var_029, 0);
}
return 1;
}
public update_menu(arg_1, arg_2, arg_3)
{
if (is_user_connected(arg_1))
{
new var1;
player_menu_info(arg_1, var1, var1 + 4, arr_011[arg_1]);
arr_012[arg_1] = 1;
menu_destroy(arg_1 + 4);
alias_menu(arg_1);
}
return 0;
}
public menu_handler(arg_1, arg_2, arg_3, arg_4, arg_5)
{
if (!arr_012[arg_1])
{
remove_task(arg_1 + 975748946, 0);
}
remove_task(arg_1 + -101289152, 0);
arr_012[arg_1] = 0;
if (arg_3 == -3)
{
menu_destroy(arg_2);
return 1;
}
new var1;
menu_item_getinfo(arg_2, arg_3, _NULLVAR_, var1, 5, _NULLVAR_, 63, _NULLVAR_);
new var2;
var2 = str_to_num(var1);
if (is_user_connected(var2))
{
arr_009[arg_1] = var2;
set_task(1,00, "show_pstatus", arg_1 + 975748946, var_030, 0, var_029, 0);
set_task(0,10, "alias_show_menu", arg_1 + 6975545, var_030, 0, var_029, 0);
menu_destroy(arg_2);
return 1;
}
client_print(arg_1, 3, "Sorry player was disconnected :(");
return 1;
}
public show_pstatus(arg_1, arg_2, arg_3)
{
if (is_user_connected(arg_1))
{
if (var2 && is_user_connected(var2))
{
if (get_user_flags(arg_1, 0) & arr_001)
{
new var3;
get_user_name(var2, var3, 32);
new var4;
new var5;
new var6;
var6 = ArraySize(g_var84);
if (var6 == arr_010[var2][0])
{
var5 = arr_019;
}
else
{
ArrayGetString(g_var84, arr_010[var2], var5, 63);
}
new var7;
var7 = arr_010[var2][0] * 30 / var6;
new var8;
var8 = 30 - var7;
new var9;
formatex(var9, var7 + 1, "%s", "**************************************");
format(var9, 31, "%s%s", var9, mul_001);
formatex(var4, 255, "Player: [%s]^nCurrnet: [%s]^nProgress: [%s]", var3, var5, var9);
set_hudmessage(var8 * 7 + 40, var7 * 7 + 40, 0, 0,70, -1,00, 0, 0,50, 1,05, 0,05, 0,05, -1);
show_hudmessage(arg_1, var4);
set_task(1,00, "show_pstatus", arg_1 + 975748946, var_030, 0, var_029, 0);
}
}
}
return 0;
}
public plugin_cfg()
{
set_task(0,50, "read_cvars", 0, var_030, 0, var_029, 0);
new var1;
func_03(var1, 127);
server_cmd("exec %s/AC/main.cfg", var1);
server_cmd("exec %s/AC/aliases.cfg", var1);
server_cmd("exec %s/AC/alias_levels.cfg", var1);
server_cmd("exec %s/AC/cvars.cfg", var1);
new var2 = 0;
while (var2 < 6)
{
arr_008[var2] = random_num(65, 90);
new var3 = 0;
while (var3 < 32)
{
arr_002[var3][var2] = arr_008[var2];
var3++;
}
var2++;
}
return 0;
}
public read_cvars()
{
g_var9456 = get_cvar_num("ac_logdays");
var_006 = get_cvar_num("ac_logs");
var_005 = get_cvar_num("ac_check_steams");
var_007 = get_cvar_num("ac_except_slowhack") > 0;
if (var_006 == 1)
{
new var1;
var1 = arr_020;
get_localinfo(var1, arr_007, 127);
add(arr_007, 127, "/AC", 0);
if (!dir_exists(arr_007, 0))
{
mkdir(arr_007, 511, 0, "GAMECONFIG");
}
new var2;
get_time("%Y_%m_%d", var2, 31);
format(arr_007, 127, "%s/%s.log", arr_007, var2);
if (g_var9456 > 1)
{
set_task(random_float(3,00, 10,00), "clear_log", 0, var_030, 0, var_029, 0);
}
}
__unk = get_cvar_num("ad_cvar_max_warns");
var_017 = get_cvar_num("ad_cvar_max_att");
__unk = get_cvar_float("ac_check_interval");
__unk = get_cvar_num("ac_nocheck") > 0;
var_022 = get_cvar_num("ac_detect_new");
if (var_022)
{
func_09();
}
return 0;
}
public form_rand_string(arg_1, arg_2, arg_3)
{
new var1 = 6;
while (var1 < 9)
{
arr_002[arg_1][var1] = random_num(97, 122);
var1++;
}
return 0;
}
public client_disconnect(arg_1, arg_2, arg_3)
{
if (task_exists(arg_1, 0))
{
remove_task(arg_1, 0);
}
if (task_exists(arg_1 + 333, 0))
{
remove_task(arg_1 + 333, 0);
}
if (task_exists(arg_1 + 64, 0))
{
remove_task(arg_1 + 64, 0);
}
if (task_exists(arg_1 + arr_003, 0))
{
remove_task(arg_1 + arr_003, 0);
}
remove_task(arg_1 + 6975545, 0);
remove_task(arg_1 + 975748946, 0);
remove_task(arg_1 + -101289152, 0);
arr_009[arg_1] = 0;
arr_005[arg_1] = 0;
arr_011[arg_1] = 0;
arr_006[arg_1] = 0;
return 0;
}
public client_putinserver(arg_1, arg_2, arg_3)
{
if (is_user_bot(arg_1) || is_user_hltv(arg_1))
{
return 0;
}
if (!g_var15496 && (var_005 || !func_06(arg_1)))
{
func_04(arg_1);
}
return 0;
}
func_04(arg_1, arg_2, arg_3)
{
arr_005[arg_1] = 0;
arr_006[arg_1] = 0;
arr_011[arg_1] = 0;
arr_009[arg_1] = 0;
set_task(random_float(9,00, 20,00), "start_check_aliases", arg_1, var_030, 0, var_029, 0);
arr_015[arg_1] = 0;
arr_016[arg_1] = 0;
set_task(1,00, "check_cvars", arg_1 + 333, var_030, 0, var_029, 0);
return 0;
}
public start_check_aliases(arg_1, arg_2, arg_3)
{
arr_005[arg_1] = 0;
form_rand_string(arg_1);
check_aliases(arg_1 + 64);
return 0;
}
public check_aliases(arg_1, arg_2, arg_3)
{
remove_task(arg_1 + 64, 0);
arg_1 += -64;
if (ArraySize(g_var84) <= arr_005[arg_1])
{
set_task(float(get_cvar_num("ac_recheck_time") * 60), "start_check_aliases", arg_1, var_030, 0, var_029, 0);
arr_005[arg_1] = 0;
return 1;
}
if (containi(var2, "say") == -1 && containi(var2, "say_team") == -1)
{
client_cmd(arg_1, "%s%s%s", var2, arr_002[arg_1], var2);
}
else
{
client_cmd(arg_1, "%s%s", arr_002[arg_1], var2);
}
client_cmd(arg_1, var2);
remove_task(arg_1 + arr_003, 0);
arr_013[arg_1] = get_user_userid(arg_1);
set_task(10,10, "check_next_alias", arg_1 + arr_003, var_030, 0, var_029, 0);
return 0;
}
public check_next_alias(arg_1, arg_2, arg_3)
{
arg_1 += -64;
if (get_user_userid(arg_1) == arr_013[arg_1])
{
if (ArraySize(g_var84) > arr_005[arg_1])
{
arr_005[arg_1]++;
}
if (func_00(g_var15492, 0))
{
remove_task(arg_1 + 64, 0);
set_task(g_var15492, "check_aliases", arg_1 + 64, var_030, 0, var_029, 0);
}
check_aliases(arg_1 + 64);
}
return 0;
}
public client_command(arg_1, arg_2, arg_3)
{
if (!is_user_connected(arg_1) || is_user_bot(arg_1) || is_user_hltv(arg_1))
{
return 0;
}
new var6;
if (!ArraySize(g_var84))
{
return 0;
}
new var7;
new var8;
if (ArraySize(g_var84) == arr_005[arg_1])
{
arr_005[arg_1] = ArraySize(g_var84) - 1;
}
if (equal(var8, "say", 3) || equal(var8, "say_team", arr_001))
{
new var9;
read_argv(1, var9, 31);
format(var7, 63, "%s %s", var7, var9);
formatex(var6, 31, "%s%s", arr_002[arg_1], var8);
}
else
{
formatex(var6, 31, "%s%s%s", var8, arr_002[arg_1], var8);
}
if (equal(var8, var7, 0) || (var_007 && (equal("NSC666x", var7, 0) || equal("vhns_Cheack", var7, 0) || equal("gbsd_", var7, 5) || equal("mfac", var7, 4))))
{
if (ArraySize(g_var84) > arr_005[arg_1])
{
arr_005[arg_1]++;
}
arr_006[arg_1] = 0;
if (func_00(g_var15492, 0))
{
remove_task(arg_1 + 64, 0);
set_task(g_var15492, "check_aliases", arg_1 + 64, var_030, 0, var_029, 0);
}
else
{
check_aliases(arg_1 + 64);
}
return 1;
}
if (equal(var6, var7, 0))
{
new var10 = arr_006[arg_1];
var10++;
if (5 < var10)
{
punisment(arg_1);
arr_006[arg_1] = 0;
}
else
{
if (func_00(g_var15492, 0))
{
remove_task(arg_1 + 64, 0);
set_task(g_var15492, "check_aliases", arg_1 + 64, var_030, 0, var_029, 0);
}
check_aliases(arg_1 + 64);
}
return 1;
}
if (contain(var7, arr_008) != -1)
{
return 1;
}
return 0;
}
public punisment(arg_1, arg_2, arg_3)
{
if (get_user_userid(arg_1) != arr_013[arg_1])
{
if (var_006 == 1)
{
log_to_file(arr_007, "[ERROR] Punishment canceled cause player changed on current slot");
}
if (var_006 == 2)
{
log_amx("[ERROR] Punishment canceled cause player changed on current slot");
}
}
else
{
new var1;
ArrayGetString(g_var84, arr_005[arg_1], var1, 63);
func_05(arg_1, ArrayGetCell(g_var88, arr_005[arg_1], 0, 0), var1);
}
return 0;
}
func_05(arg_1, arg_2, arg_3, arg_4, arg_5)
{
new var1;
new var2;
new var3;
new var4;
new var5;
new var6;
new var7;
new var8;
formatex(var8, 15, "reason#%d", arg_2);
if (!TrieKeyExists(g_var92, var8))
{
if (var_006 == 1)
{
log_to_file(arr_007, "[ERROR] reason for level %d not found :(", arg_2);
}
if (var_006 == 2)
{
log_amx("[ERROR] reason for level %d not found :(", arg_2);
}
var6 = arr_021;
}
else
{
TrieGetString(g_var92, var8, var6, 63, 0);
}
formatex(var8, 15, "punish#%d", arg_2);
if (!TrieKeyExists(g_var92, var8))
{
if (var_006 == 1)
{
log_to_file(arr_007, "[ERROR] punishment for level %d not found :(", arg_2);
}
if (var_006 == 2)
{
log_amx("[ERROR] punishment for level %d not found :(", arg_2);
}
var5 = arr_022;
}
else
{
TrieGetString(g_var92, var8, var5, 127, 0);
}
if (4 > strlen(var5))
{
return 0;
}
formatex(var8, 15, "time#%d", arg_2);
if (!TrieKeyExists(g_var92, var8))
{
if (var_006 == 1)
{
log_to_file(arr_007, "[ERROR] reason for level %d not found :(", arg_2);
}
if (var_006 == 2)
{
log_amx("[ERROR] reason for level %d not found :(", arg_2);
}
var7 = arr_023;
}
else
{
TrieGetString(g_var92, var8, var7, 15, 0);
}
format(var1, 7, "#%d", get_user_userid(arg_1));
get_user_info(arg_1, "name", var3, 63);
get_user_ip(arg_1, var2, 31, 1);
get_user_authid(arg_1, var4, 63);
format(var3, 63, "\"%s\"", var3);
func_02(var5, arr_004, "%userid%", var1);
func_02(var5, arr_004, "%time%", var7);
func_02(var5, arr_004, "%ip%", var2);
func_02(var5, arr_004, "%auth%", var4);
func_02(var5, arr_004, "%reason%", var6);
func_02(var5, arr_004, "%name%", var3);
server_cmd(var5);
if (var_006 == 1)
{
log_to_file(arr_007, "[DETECT] [%s] [%s] [%s] %s level %d detected", var3, var2, var1, arg_3, arg_2);
}
if (var_006 == 2)
{
log_amx("[DETECT] [%s] [%s] [%s] %s level %d detected", var3, var2, var1, arg_3, arg_2);
}
return 0;
}
public clear_log()
{
new var1;
var1 = arr_024;
new var2;
get_localinfo(var1, var2, 127);
add(var2, 127, "/AC", 0);
new var3;
new var4;
var4 = open_dir(var2, var3, 15, 0, 0, "GAME");
if (var4)
{
while (next_file(var4, var3, 15, 0))
{
if (0 < parse_time(var3, "%Y_%m_%d.log", -1))
{
if (get_systime(0) - g_var9456 * 60 * 60 * 24 > parse_time(var3, "%Y_%m_%d.log", -1))
{
new var5;
format(var5, 80, "%s\%s", var2, var3);
delete_file(var5, 0, "GAMECONFIG");
}
}
}
}
close_dir(var4);
return 0;
}
public alias_add_time()
{
if (func_01(var3) && strlen(var3) > 0 && str_to_num(var3) > 0)
{
if (!var4 || !func_01(var4))
{
console_print(0, "USE: ac_set_alias_time <level> <time>");
console_print(0, "Example: ac_set_alias_time 3 30000");
}
else
{
new var5;
formatex(var5, 15, "time#%s", var3);
TrieSetString(g_var92, var5, var4, 1);
TrieSetCell(var_003, var5, 1, 1);
}
}
else
{
console_print(0, "USE: ac_set_alias_time <level> <time>");
console_print(0, "Example: ac_set_alias_time 3 30000");
}
return 0;
}
public alias_add_reason()
{
if (func_01(var2) && strlen(var2) > 0 && str_to_num(var2) > 0)
{
read_argv(2, var3, 127);
if (3 > strlen(var3))
{
console_print(0, "USE: ac_set_alias_reason <level> <reason>");
console_print(0, "Example: ac_set_alias_reason 3 \"Bhop detected\"");
}
else
{
new var4;
formatex(var4, 15, "reason#%s", var2);
format(var3, 127, "\"%s\"", var3);
TrieSetString(g_var92, var4, var3, 1);
}
}
else
{
console_print(0, "USE: ac_set_alias_reason <level> <reason>");
console_print(0, "Example: ac_set_alias_reason 3 \"Bhop detected\"");
}
return 0;
}
public alias_add_punish()
{
if (func_01(var3) && strlen(var3) > 0 && str_to_num(var3) > 0)
{
if (strlen(var4) < 10 || contain(var4, "%") < 0)
{
console_print(0, "USE: ac_set_alias_punish <level> <punishment>");
console_print(0, "Example: ac_set_alias_punish 3 \"amx_ban %stime%s %suserid%s %sreason%s\"", "%s", "%s", "%s", "%s", "%s", "%s");
}
else
{
new var5;
formatex(var5, 15, "punish#%s", var3);
TrieSetString(g_var92, var5, var4, 1);
}
}
else
{
console_print(0, "USE: ac_set_alias_punish <level> <punishment>");
console_print(0, "Example: ac_set_alias_punish 3 \"amx_ban %stime%s %suserid%s %sreason%s\"", "%s", "%s", "%s", "%s", "%s", "%s");
}
return 0;
}
public alias_add()
{
if (func_01(var2) && strlen(var2) > 0 && str_to_num(var2) > 0)
{
read_argv(2, var3, 64);
if (!var3)
{
console_print(0, "USE: ad_add_alias <level> <alias>");
console_print(0, "Example: ad_add_alias 3 \"+superbhop\"");
}
else
{
ArrayPushString(g_var84, var3);
ArrayPushCell(g_var88, str_to_num(var2));
}
}
else
{
console_print(0, "USE: ad_add_alias <level> <alias>");
console_print(0, "Example: ad_add_alias 3 \"+superbhop\"");
}
return 1;
}
func_06(arg_1, arg_2, arg_3)
{
if (g_var27932 || (g_var27932 = get_cvar_pointer("dp_r_id_provider")))
{
server_cmd("dp_clientinfo %d", arg_1);
server_exec();
new var2;
if (get_pcvar_num(g_var27932) == 2)
{
var2 = 1;
}
else
{
var2 = 0;
}
return var2;
}
return 0;
}
public check_cvars(arg_1, arg_2, arg_3)
{
new var2;
var2 = arr_015[arg_1];
if (ArraySize(g_var10696) < var2 + 1)
{
if (!var_033)
{
var_033 = 1;
var_032 = get_cvar_float("ad_cvar_recheck_time");
}
if (func_00(var_032, 0))
{
remove_task(arg_1 + 333, 0);
arr_015[arg_1] = 0;
return set_task(var_032, "check_cvars", arg_1 + 333, var_030, 0, var_029, 0);
}
return remove_task(arg_1 + 333, 0);
}
if (!is_user_connected(arg_1) || is_user_bot(arg_1) || is_user_hltv(arg_1))
{
return remove_task(arg_1 + 333, 0);
}
var_034 = ArrayGetCell(g_var10712, var2, 0, 0);
ArrayGetString(g_var10696, var2, arr_025, 63);
new var3;
var3 = get_user_userid(arg_1);
var3 + 4 = var2;
var3 + arr_001 = var_034;
mul_000[arg_1] = 0;
query_client_cvar(arg_1, arr_025, "qcc", 3, var3);
return set_task(1,00, "check_value", arg_1, var3, 3, var_029, 0);
}
public qcc(arg_1, arg_2, arg_3, arg_4, arg_5, arg_6)
{
if (arg_4 != get_user_userid(arg_1))
{
return log_to_file("error_cvars.log", "Some crap #1");
}
copy(mul_000[arg_1], 31, arg_3);
return 1;
}
public check_value(arg_1, arg_2, arg_3, arg_4)
{
if (get_user_userid(arg_2) == arg_1)
{
new var4;
var4 = arg_1 + arr_001;
if (var4 & 1)
{
if (!mul_000[arg_2])
{
ArrayGetString(g_var10696, arg_1 + 4, arr_026, 63);
get_user_name(arg_2, arr_027, 31);
log_to_file(arr_007, "CANT GET [%s] [Player %s]", arr_026, arr_027);
new var5 = arr_016[arg_2];
var5++;
if (var_017 < var5)
{
arr_016[arg_2] = 0;
return func_07(arg_2, arg_1 + 4);
}
return set_task(0,50, "check_cvars", arg_2 + 333, var_030, 0, var_029, 0);
}
}
if (var4 & 2)
{
if (func_01(var6) && func_01(var7))
{
if (var8 < str_to_num(var6) || var8 > str_to_num(var7))
{
get_user_name(arg_2, arr_028, 31);
ArrayGetString(g_var10696, arg_1 + 4, arr_029, 63);
log_to_file(arr_007, "WRONG VALUE [%s %d] [player %s]", arr_029, var8, arr_028);
if (var4 & 4)
{
new var9 = arr_016[arg_2];
var9++;
if (var_017 < var9)
{
arr_016[arg_2] = 0;
return func_07(arg_2, arg_1 + 4);
}
new var10;
ArrayGetString(g_var10696, arg_1 + 4, var10, 63);
client_cmd(arg_2, "%s %d", var10, clamp(var8, str_to_num(var6), str_to_num(var7)));
return set_task(0,90, "check_cvars", arg_2 + 333, var_030, 0, var_029, 0);
}
return func_07(arg_2, arg_1 + 4);
}
}
}
if (var4 & arr_001)
{
if (equali(mul_000[arg_2], var11, 0) || equali(mul_000[arg_2], var12, 0))
{
get_user_name(arg_2, arr_030, 31);
ArrayGetString(g_var10696, arg_1 + 4, arr_031, 63);
log_to_file(arr_007, "BAD VALUE [%s %s] [player %s]", arr_031, mul_000[arg_2], arr_030);
return func_07(arg_2, arg_1 + 4);
}
}
arr_015[arg_2]++;
set_task(0,90, "check_cvars", arg_2 + 333, var_030, 0, var_029, 0);
mul_000[arg_2] = 0;
}
return 1;
}
func_07(arg_1, arg_2, arg_3, arg_4)
{
new var1;
if (arg_2 != 9999)
{
num_to_str(ArrayGetCell(g_var10708, arg_2, 0, 0), var1, 9);
}
else
{
var1 = arr_032;
}
new var2;
if (TrieKeyExists(var_018, var1))
{
TrieGetString(var_018, var1, var2, g_var92, 0);
}
else
{
log_to_file(arr_007, "Punishment [%s] not found - default WARN +1 will be used", var1);
var2 = arr_033;
}
new var3;
new var4;
new var5;
new var6;
format(var3, 7, "#%d", get_user_userid(arg_1));
get_user_info(arg_1, "name", var4, 63);
get_user_ip(arg_1, var6, 31, 1);
get_user_authid(arg_1, var5, 63);
format(var4, 63, "\"%s\"", var4);
func_02(var2, arr_004, "%userid%", var3);
func_02(var2, arr_004, "%ip%", var6);
func_02(var2, arr_004, "%auth%", var5);
func_02(var2, arr_004, "%name%", var4);
server_cmd(var2);
new var7;
if (arg_2 != 9999)
{
ArrayGetString(g_var10696, arg_2, var7, 63);
}
else
{
formatex(var7, 63, "max warns");
}
get_user_info(arg_1, "name", var4, 63);
log_to_file(arr_007, "[PUNISH] [%s] for [%s]", var4, var7);
arr_015[arg_1]++;
set_task(0,90, "check_cvars", arg_1 + 333, var_030, 0, var_029, 0);
return 1;
}
public cvar_add()
{
new var1;
new var2;
new var3;
new var4;
new var5;
read_argv(1, var1, 15);
trim(var1);
if (!strlen(var1))
{
return func_08();
}
if (!func_01(var1))
{
return func_08();
}
read_argv(2, var2, 15);
trim(var2);
if (!strlen(var2))
{
return func_08();
}
if (!func_01(var2))
{
return func_08();
}
read_argv(3, var3, 63);
if (!strlen(var3))
{
return func_08();
}
read_argv(4, var5, 31);
if (!strlen(var5))
{
return func_08();
}
read_argv(5, var4, 31);
if (!strlen(var4))
{
return func_08();
}
ArrayPushString(g_var10696, var3);
ArrayPushString(g_var10700, var5);
ArrayPushString(g_var10704, var4);
ArrayPushCell(g_var10708, str_to_num(var1));
ArrayPushCell(g_var10712, str_to_num(var2));
return 1;
}
func_08()
{
console_print(0, "USE: ad_cvar_add <level> <flags> <cvar> <min> <max>");
console_print(0, "Example: ad_cvar_add 10 1 rate 20000 100000");
return 1;
}
public cvar_add_punish()
{
if (func_01(var3) && strlen(var3) > 0 && str_to_num(var3) > 0)
{
if (strlen(var4) < 10 || contain(var4, "%") < 0)
{
console_print(0, "USE: ac_set_cvar_punish <level> <punishment>");
console_print(0, "Example: ac_set_cvar_punish 3 \"amx_ban %stime%s %suserid%s %sreason%s\"", "%", "%", "%", "%", "%", "%");
}
else
{
new var5;
formatex(var5, 15, "%s", var3);
TrieSetString(var_018, var5, var4, 1);
}
}
else
{
console_print(0, "USE: ac_set_cvar_punish <level> <punishment>");
console_print(0, "Example: ac_set_cvar_punish 3 \"amx_ban %stime%s %suserid%s %sreason%s\"", "%", "%", "%", "%", "%", "%");
}
return 1;
}
public cvar_add_warn()
{
new var1;
new var2;
read_argv(1, var1, 9);
trim(var1);
read_argv(2, var2, 9);
trim(var2);
if (var1 != 35)
{
return log_to_file(arr_007, "[ERROR in cvar_add_warn USE #userid warnsnum]");
}
if (!func_01(var2))
{
return log_to_file(arr_007, "[ERROR in cvar_add_warn USE #userid warnsnum]");
}
new var3;
var3 = find_player("k", str_to_num(var1 + 4));
if (0 < var3)
{
new var4;
get_user_name(var3, var4, 31);
log_to_file(arr_007, "[WARN ADD] add %d warn's for player %s", str_to_num(var2), var4);
new var5 = arr_017[var3];
var5 = str_to_num(var2) + var5;
if (g_var15488 < arr_017[var3])
{
arr_017[var3] = 0;
log_to_file(arr_007, "[PUNISH] Player %s for max warns", var4);
func_07(var3, 9999);
}
}
return 1;
}
func_09()
{
func_11();
register_message(get_user_msgid("TextMsg"), "msgTextMsg");
return 0;
}
public msgTextMsg(arg_1, arg_2, arg_3, arg_4, arg_5)
{
if (arg_2 == 1)
{
get_msg_arg_string(2, arr_034, 31);
if (equal(arr_034, "#Game_unknown_command", 0))
{
get_msg_arg_string(3, arr_034, 63);
return func_10(arg_3, arr_034);
}
}
return 0;
}
func_10(arg_1, arg_2, arg_3, arg_4)
{
if (TrieKeyExists(var_023, arg_2))
{
new var1;
var1 = arg_1;
var1 + 4 = get_user_userid(arg_1);
TrieGetCell(var_023, arg_2, var1 + arr_001);
formatex(var1 + 40, 48, arg_2);
set_task(random_float(5,00, 20,00), "bad_cmd_found", arg_1, var1, 64, var_029, 0);
return 1;
}
if (var_008)
{
new var2;
var2 = dyncheck_cmds(arg_2);
if (var2)
{
var2--;
new var3;
var3 = arg_1;
var3 + 4 = get_user_userid(arg_1);
var3 + arr_001 = ArrayGetCell(g_var10716, var2, 0, 0);
var3 + 12 = ArrayGetCell(var_015, var2, 0, 0);
formatex(var3 + 40, 48, arg_2);
set_task(random_float(5,00, 20,00), "bad_cmd_found", arg_1, var3, 64, var_029, 0);
return 1;
}
}
if (!TrieKeyExists(var_003, arg_2))
{
get_user_name(arg_1, arr_035, 31);
get_user_ip(arg_1, arr_036, 15, 1);
get_user_authid(arg_1, arr_037, 31);
if (arg_2 == 45)
{
formatex(arr_038, 127, "ac_new_cmd +%s // By [%d] [%s] [%s] [%s]", arg_2 + 4, arg_1, arr_035, arr_036, arr_037);
write_file(arr_014, arr_038, -1);
}
formatex(arr_038, 127, "ac_new_cmd %s // By [%d] [%s] [%s] [%s]", arg_2, arg_1, arr_035, arr_036, arr_037);
write_file(arr_014, arr_038, -1);
TrieSetCell(var_003, arg_2, 1, 1);
}
return 0;
}
func_11()
{
new var1;
func_03(var1, 127);
var_023 = TrieCreate();
g_var10716 = ArrayCreate(1, 32);
var_015 = ArrayCreate(1, 32);
var_016 = ArrayCreate(64, 32);
formatex(arr_014, 127, "%s/AC/new_aliases.cfg", var1);
server_cmd("exec %s/AC/bad_cmds.cfg", var1);
register_srvcmd("ac_new_cmd", "ac_new_cmd", -1, "ac_new_cmd <command>", 0);
register_srvcmd("ac_add_cmd", "ac_add_cmd", -1, "ac_add_cmd <level> <command>", 0);
server_cmd("exec %s", arr_014);
return 0;
}
public ac_new_cmd()
{
new var1;
read_argv(1, var1, 63);
if (var1)
{
TrieSetCell(var_003, var1, 1, 1);
}
return 0;
}
public ac_add_cmd()
{
if (func_01(var3) && strlen(var3) > 0 && str_to_num(var3) > 0)
{
if (!var5 || var6 > 3 || var6 < 0)
{
console_print(0, "USE: ad_add_cmd <level> <flags> <command>");
console_print(0, "Example: ad_add_cmd 3 2 \"+superbhop\"");
}
else
{
if (var6)
{
ArrayPushString(var_016, var5);
ArrayPushCell(var_015, var6);
ArrayPushCell(g_var10716, str_to_num(var3));
var_008 = 1;
}
if (!TrieKeyExists(var_023, var5))
{
TrieSetCell(var_023, var5, str_to_num(var3), 1);
}
}
}
else
{
console_print(0, "USE: ad_add_cmd <level> <command>");
console_print(0, "Example: ad_add_cmd 3 \"+superbhop\"");
}
return 1;
}
public dyncheck_cmds(arg_1, arg_2, arg_3)
{
new var3 = 0;
new var4;
formatex(var4, 63, arg_1);
strtolower(var4);
new var5;
var5 = strlen(var4);
new var6;
var6 = ArraySize(var_016);
new var7 = 0;
while (var7 < var6 && !var3)
{
new var8;
ArrayGetString(var_016, var7, var8, 127);
switch (ArrayGetCell(var_015, var7, 0, 0))
{
case 1:
{
if (var5 - strlen(var8) == containi(var4, var8) && containi(var4, var8) != -1)
{
var3 = var7 + 1;
}
}
case 2:
{
if (containi(var4, var8))
{
}
else
{
var3 = var7 + 1;
}
}
case 3:
{
if (containi(var4, var8) != -1)
{
var3 = var7 + 1;
}
}
default:
{
}
}
var7++;
}
return var3;
}
public bad_cmd_found(arg_1, arg_2, arg_3, arg_4)
{
if (arg_1 + 4 == get_user_userid(arg_2))
{
new var1;
switch (arg_1 + 12)
{
case 0:
{
formatex(var1, 63, "%s", arg_1 + 40);
}
case 1:
{
formatex(var1, 63, "*%s", arg_1 + 40);
}
case 2:
{
formatex(var1, 63, "%s*", arg_1 + 40);
}
case 3:
{
formatex(var1, 63, "*%s*", arg_1 + 40);
}
default:
{
}
}
func_05(arg_2, arg_1 + arr_001, var1);
}
return 0;
}