Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin

dod_blockexploits170

by Unknown · 2006-03-23

recovered from the server

From the first post

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.

Files

dod_blockexploits170_635.amxx Compiled Plugin 8 KB Download

Decompiled source reconstructed

dod_blockexploits170_635.amxx was published compiled only. This Pawn was recovered from the bytecode with Lysis — 334 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_blockexploits170_635.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[4][0] =n{n	{n		83, ...n	},n	{n		87, ...n	},n	{n		82, ...n	},n	{n		78, ...n	}n};npublic plugin_init()n{n	register_plugin("DoD BlockExploits", "1.2", "[RST] FireStorm");n	register_event("CurWeapon", "block_pistolzoom", 1104, "1=0", "2=6", "2=9", "2=25");n	register_event("CurWeapon", "block_mgreload", 1280, "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 4", "block_speckilling", -1, {0});n	register_clcmd("jointeam 5", "block_autoassign", -1, {0});n	register_cvar("dod_blockexploits_speckilling", 2452, noteamchange, noteamchange);n	register_cvar("dod_blockexploits_respawntimer", 2584, noteamchange, noteamchange);n	register_cvar("dod_blockexploits_whitemodel", 2708, noteamchange, noteamchange);n	register_cvar("dod_blockexploits_mgreload", 2824, noteamchange, noteamchange);n	register_cvar("dod_blockexploits_message", "Exploiting isn't welcome here!", noteamchange, noteamchange);n	register_cvar("dod_blockexploits_log", 3148, noteamchange, noteamchange);n	register_cvar("dod_blockexploits_bantime", 3260, noteamchange, noteamchange);n	register_cvar("dod_blockexploits_useamxbans", 3384, 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 kick_hacker(id)n{n	new hackername[32];n	get_user_name(id, hackername, 31);n	client_print(noteamchange, 3, "[DoD BlockExploits] Player %s has been kicked for exploiting!", hackername);n	new hackerid = get_user_userid(id);n	server_cmd("kick #%d Exploiting NOT allowed!", hackerid);n	return 1;n}nnpublic ban_hacker(id)n{n	new hackername[32];n	get_user_name(id, hackername, 31);n	client_print(noteamchange, 3, "[DoD BlockExploits] Player %s has been banned for exploiting!", hackername);n	new hackerbantime = get_cvar_num("dod_blockexploits_bantime");n	if (get_cvar_num("dod_blockexploits_useamxbans"))n	{n		if (get_cvar_num("dod_blockexploits_useamxbans") == 1)n		{n			new hackerauth[32];n			get_user_authid(id, hackerauth, 31);n			server_cmd("amx_ban %d %s %s", hackerbantime, hackerauth, crimemsg[crime[id]]);n		}n	}n	elsen	{n		new hackerid = get_user_userid(id);n		server_cmd("banid %d #%d kick;writeid", hackerbantime, hackerid);n	}n	return 1;n}nnpublic show_warning(id)n{n	new warnmsg[256];n	get_cvar_string("dod_blockexploits_message", warnmsg, 256);n	client_print(id, 3, "[DoD BlockExploits] %s", warnmsg);n	return 1;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, 5120, 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		handle_timercheat(id);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		handle_timercheat(id);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	handle_whitemodel(id);n	return 1;n}nnpublic block_speckilling(id)n{n	handle_speckilling(id);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			handle_mgreload(id);n			return 0;n		}n		new var2;n		if (mgtype == 17 && clip != 250)n		{n			client_cmd(id, "-reload");n			handle_mgreload(id);n			return 0;n		}n		new var3;n		if (mgtype == 18 && clip != 150)n		{n			client_cmd(id, "-reload");n			handle_mgreload(id);n			return 0;n		}n		return 0;n	}n	return 0;n}nnpublic handle_speckilling(id)n{n	if (get_cvar_num("dod_blockexploits_speckilling") == 1)n	{n		show_warning(id);n	}n	elsen	{n		if (get_cvar_num("dod_blockexploits_speckilling") == 2)n		{n			kick_hacker(id);n		}n		if (get_cvar_num("dod_blockexploits_speckilling") == 3)n		{n			crime[id] = 0;n			ban_hacker(id);n		}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 handle_whitemodel(id)n{n	if (get_cvar_num("dod_blockexploits_whitemodel") == 1)n	{n		show_warning(id);n	}n	elsen	{n		if (get_cvar_num("dod_blockexploits_whitemodel") == 2)n		{n			kick_hacker(id);n		}n		if (get_cvar_num("dod_blockexploits_whitemodel") == 3)n		{n			crime[id] = 1;n			ban_hacker(id);n		}n	}n	if (get_cvar_num("dod_blockexploits_log") == 1)n	{n		crime[id] = 1;n		log_hacker(id);n	}n	return 1;n}nnpublic handle_timercheat(id)n{n	if (get_cvar_num("dod_blockexploits_respawntimer") == 1)n	{n		show_warning(id);n	}n	if (get_cvar_num("dod_blockexploits_log") == 1)n	{n		crime[id] = 2;n		log_hacker(id);n	}n	return 1;n}nnpublic handle_mgreload(id)n{n	if (get_cvar_num("dod_blockexploits_mgreload") == 1)n	{n		show_warning(id);n	}n	elsen	{n		if (get_cvar_num("dod_blockexploits_mgreload") == 2)n		{n			kick_hacker(id);n		}n		if (get_cvar_num("dod_blockexploits_mgreload") == 3)n		{n			crime[id] = 3;n			ban_hacker(id);n		}n	}n	if (get_cvar_num("dod_blockexploits_log") == 1)n	{n		crime[id] = 3;n		log_hacker(id);n	}n	return 1;n}nn
DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC