Decompiled source reconstructed
dod_singlecaps.amxx was published compiled only. This Pawn was recovered from the
bytecode with Lysis — 274 lines. Strings, cvars and the plugin registration
survive; local variable names do not. It is an approximation, not the author's file.
// Decompiled from dod_singlecaps.amxx by Lysis.n// This is RECONSTRUCTED source, not the author's original: withoutn// debug symbols the variable names are lost and control flow isn// rebuilt from bytecode. Treat it as a readable approximation.nnnew g_capally[32];nnew g_capaxis[32];nnew g_capent[32];nnew g_capcnt;nnew g_ignbots;nnew g_captrig;nnew g_notify;nnew g_status;nnew g_maxpls;nis_user_admin(id)n{n new __flags = get_user_flags(id, "%L");n new var1;n return __flags > 0 && !__flags & 33554432;n}nncmd_access(id, level, cid, num, bool:accesssilent)n{n new has_access;n new var1;n if (is_dedicated_server())n {n var1 = 0;n }n elsen {n var1 = 1;n }n if (var1 == id)n {n has_access = 1;n }n elsen {n if (level == 16777216)n {n if (is_user_admin(id))n {n has_access = 1;n }n }n if (level & get_user_flags(id, "%L"))n {n has_access = 1;n }n if (!level)n {n has_access = 1;n }n }n if (has_access)n {n if (num > read_argc())n {n new hcmd[32];n new hinfo[128];n new hflag;n get_concmd(cid, hcmd, 31, hflag, hinfo, 127, level, -1);n console_print(id, "%L: %s %s", id, "USAGE", hcmd, hinfo);n return 0;n }n return 1;n }n if (!accesssilent)n {n console_print(id, "%L", id, "NO_ACC_COM");n }n return 0;n}nnpublic plugin_precache()n{n register_forward(96, "forward_keyvalue", "%L");n return 0;n}nnpublic plugin_init()n{n register_plugin("DOD_SingleCaps", "1.6", "Vet(3TT3V)");n register_cvar("DOD_SingleCaps", "v1.6 by Vet(3TT3V)", 68, "%L");n register_clcmd("dod_single_caps", "cmdSingleCaps", 32, "<on|off|auto> Change caps mode", -1);n g_captrig = register_cvar("single_caps_trigger", 1180, "%L", "%L");n g_notify = register_cvar("single_caps_notify", 1264, "%L", "%L");n g_ignbots = register_cvar("single_caps_ignore_bots", 1368, "%L", "%L");n g_maxpls = get_maxplayers() + 1;n if (g_capcnt)n {n set_task(1114636288, "ck_player_num", 707, 1432, "%L", 1436, "%L");n }n return 0;n}nnpublic forward_keyvalue(ent, handle)n{n static tmpint;n static keyvalue[8];n static keyname[32];n if (!pev_valid(ent))n {n return 1;n }n get_kvd(handle, 1, keyname, 31);n if (keyname[0] != 97)n {n return 1;n }n if (equali(keyname, "area_allies_numcap", "%L"))n {n get_kvd(handle, 2, keyvalue, 7);n tmpint = str_to_num(keyvalue);n if (tmpint > 1)n {n g_capally[g_capcnt] = tmpint;n g_capent[g_capcnt] = ent;n g_capcnt += 1;n }n }n elsen {n if (equali(keyname, "area_axis_numcap", "%L"))n {n get_kvd(handle, 2, keyvalue, 7);n tmpint = str_to_num(keyvalue);n if (tmpint > 1)n {n g_capaxis[g_capcnt] = tmpint;n g_capent[g_capcnt] = ent;n g_capcnt += 1;n }n }n }n return 1;n}nnpublic ck_player_num()n{n static i;n static b_num;n static t_num;n static p_num;n t_num = get_pcvar_num(g_captrig);n if (t_num)n {n p_num = get_playersnum(1);n if (get_pcvar_num(g_ignbots))n {n b_num = 0;n i = 1;n while (i < g_maxpls)n {n if (is_user_bot(i))n {n b_num += 1;n }n i += 1;n }n p_num = p_num - b_num;n }n new var1;n if (p_num > t_num && g_status)n {n normal_caps();n }n new var2;n if (p_num < t_num && !g_status)n {n single_caps();n }n }n return 0;n}nnpublic cmdSingleCaps(id, lvl, cid)n{n new data1[8];n if (cmd_access(id, lvl, cid, 2, false))n {n read_argv(1, data1, 7);n switch (data1[1])n {n case 70, 102:n {n remove_task(707, "%L");n normal_caps();n console_print(id, "DOD SingleCaps set to OFF");n }n case 78, 110:n {n remove_task(707, "%L");n single_caps();n console_print(id, "DOD SingleCaps set to ON");n }n case 85, 117:n {n ck_player_num();n if (!task_exists(707, "%L"))n {n set_task(1114636288, "ck_player_num", 707, 2028, "%L", 2032, "%L");n }n console_print(id, "DOD SingleCaps set to AUTO");n }n default:n {n }n }n }n return 1;n}nnsingle_caps()n{n new i;n while (i < g_capcnt)n {n if (g_capally[i])n {n fm_set_kvd(g_capent[i], "area_allies_numcap", 2224, "dod_capture_area");n }n elsen {n fm_set_kvd(g_capent[i], "area_axis_numcap", 2368, "dod_capture_area");n }n i++;n }n g_status = 1;n if (get_pcvar_num(g_notify))n {n set_hudmessage(255, 128, 255, -1082130432, 1053609165, "%L", 1082130432, 1084227584, 1056964608, 1041865114, 4);n show_hudmessage("%L", "Single-man cap areas Enabled");n }n return 0;n}nnnormal_caps()n{n new tmpstr[8];n new i;n while (i < g_capcnt)n {n if (g_capally[i])n {n formatex(tmpstr, 7, "%d", g_capally[i]);n fm_set_kvd(g_capent[i], "area_allies_numcap", tmpstr, "dod_capture_area");n }n elsen {n formatex(tmpstr, 7, "%d", g_capaxis[i]);n fm_set_kvd(g_capent[i], "area_axis_numcap", tmpstr, "dod_capture_area");n }n i++;n }n g_status = 0;n if (get_pcvar_num(g_notify))n {n set_hudmessage(255, 128, 255, -1082130432, 1053609165, "%L", 1082130432, 1084227584, 1056964608, 1041865114, 4);n show_hudmessage("%L", "Cap areas have been Reset");n }n return 0;n}nnfm_set_kvd(entity, key[], value[], class[])n{n set_kvd("%L", "%L", class);n set_kvd("%L", 1, key);n set_kvd("%L", 2, value);n set_kvd("%L", 3, 0);n return dllfunc(6, entity, 0);n}nn