Recovered from the archived server. This was never posted on the forum, so there is no thread behind it and no author post to quote — the attribution below comes from the plugin's own register_plugin() call where it has one.
dod_blockexploits160
by Unknown · 2005-09-30
recovered from the server
From the first post
Files
| dod_blockexploits160_142.amxx | Compiled Plugin | 6 KB | Download |
Decompiled source reconstructed
dod_blockexploits160_142.amxx was published compiled only. This Pawn was recovered from the
bytecode with Lysis — 229 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_blockexploits160_142.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 noteamchange[33];nnew playerteam[33];nnew g_msgsetFOV;nnew crime[33];nnew crimemsg[3][0] =n{n {n 87, ...n },n {n 82, ...n },n {n 78, ...n }n};npublic plugin_init()n{n register_plugin("DoD BlockExploits", "1.5", "[RST] FireStorm");n register_event("CurWeapon", "block_pistolzoom", 996, "1=0", "2=6", "2=9", "2=25");n register_event("CurWeapon", "block_mgreload", 1172, "1=1", "2=17", "2=18", "2=21");n g_msgsetFOV = get_user_msgid("SetFOV");n register_clcmd("cls_mortar", "block_whitemodel", -1, {0});n register_clcmd("cls_germortar", "block_whitemodel", -1, {0});n register_clcmd("cls_britmortar", "block_whitemodel", -1, {0});n register_clcmd("jointeam 1", "block_alliesrejoin", -1, {0});n register_clcmd("jointeam 2", "block_axisrejoin", -1, {0});n register_clcmd("jointeam 3", "block_timercheat", -1, {0});n register_clcmd("jointeam 5", "block_autoassign", -1, {0});n register_cvar("dod_blockexploits_log", 2196, noteamchange, noteamchange);n return 0;n}nnpublic plugin_modules()n{n require_module("dodx");n require_module("engine");n return 0;n}nnpublic client_authorized(id)n{n client_cmd(id, "firstperson");n noteamchange[id] = 0;n playerteam[id] = 0;n return 0;n}nnpublic log_hacker(id)n{n new hackername[32];n new hackerauth[32];n new hackerip[32];n get_user_name(id, hackername, 31);n get_user_authid(id, hackerauth, 31);n get_user_ip(id, hackerip, 31, 1);n log_to_file("dod_blockexploits.log", "[DoD BlockExploits] %s <%s> <%s> has been caught %s!", hackername, hackerauth, hackerip, crimemsg[crime[id]]);n return 1;n}nnpublic block_pistolzoom(id)n{n if (!g_msgsetFOV)n {n return 0;n }n message_begin(1, g_msgsetFOV, 2600, id);n write_byte(noteamchange);n message_end();n return 0;n}nnpublic block_timercheat(id)n{n if (get_cvar_num("mp_allowspectators"))n {n if (noteamchange[id] == 1)n {n return 1;n }n playerteam[id] = get_user_team(id, {0}, noteamchange);n noteamchange[id] = 1;n set_task(1097859072, "allow_teamchange", id, {0}, noteamchange, {0}, noteamchange);n return 0;n }n return 0;n}nnpublic allow_teamchange(id)n{n if (noteamchange[id] == 1)n {n noteamchange[id] = 0;n }n return 1;n}nnpublic block_autoassign(id)n{n if (noteamchange[id] == 1)n {n return 1;n }n return 0;n}nnpublic block_axisrejoin(id)n{n new var1;n if (playerteam[id] == 2 && noteamchange[id] == 1)n {n if (is_user_bot(id))n {n return 1;n }n if (get_cvar_num("dod_blockexploits_log") == 1)n {n crime[id] = 1;n log_hacker(id);n }n return 1;n }n if (task_exists(id, noteamchange))n {n remove_task(id, noteamchange);n }n noteamchange[id] = 0;n playerteam[id] = 0;n return 0;n}nnpublic block_alliesrejoin(id)n{n new var1;n if (playerteam[id] == 1 && noteamchange[id] == 1)n {n if (is_user_bot(id))n {n return 1;n }n if (get_cvar_num("dod_blockexploits_log") == 1)n {n crime[id] = 1;n log_hacker(id);n }n return 1;n }n if (task_exists(id, noteamchange))n {n remove_task(id, noteamchange);n }n noteamchange[id] = 0;n playerteam[id] = 0;n return 0;n}nnpublic block_whitemodel(id)n{n if (is_user_bot(id))n {n return 1;n }n if (get_cvar_num("dod_blockexploits_log") == 1)n {n crime[id] = 0;n log_hacker(id);n }n return 1;n}nnpublic block_mgreload(id)n{n if (entity_get_int(id, 34) & 8192)n {n new clip;n new ammo;n new mgtype = dod_get_user_weapon(id, clip, ammo);n new var1;n if (mgtype == 21 && clip != 75)n {n client_cmd(id, "-reload");n if (!(is_user_bot(id)))n {n if (get_cvar_num("dod_blockexploits_log") == 1)n {n crime[id] = 2;n log_hacker(id);n }n }n return 0;n }n new var2;n if (mgtype == 17 && clip != 250)n {n client_cmd(id, "-reload");n if (!(is_user_bot(id)))n {n if (get_cvar_num("dod_blockexploits_log") == 1)n {n crime[id] = 2;n log_hacker(id);n }n }n return 0;n }n new var3;n if (mgtype == 18 && clip != 150)n {n client_cmd(id, "-reload");n if (!(is_user_bot(id)))n {n if (get_cvar_num("dod_blockexploits_log") == 1)n {n crime[id] = 2;n log_hacker(id);n }n }n return 0;n }n return 0;n }n return 0;n}nn

