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

capspunisher

by Unknown · 2005-07-16

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

capspunisher.amxx Compiled Plugin 4 KB Download

Decompiled source reconstructed

capspunisher.amxx was published compiled only. This Pawn was recovered from the bytecode with Lysis — 109 lines. Strings, cvars and the plugin registration survive; local variable names do not. It is an approximation, not the author's file.

// Decompiled from capspunisher.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.nnpublic plugin_init()n{n	register_plugin("CAPS Punisher", "0.3b", "AMXX DoD Team");n	register_clcmd("say", "say_hook", -1, {0});n	register_clcmd("say_team", "say_hook", -1, {0});n	register_cvar("amx_caps_minlen", 324, "CAPS Punisher", "CAPS Punisher");n	register_cvar("amx_caps_minpercent", "50", "CAPS Punisher", "CAPS Punisher");n	register_cvar("amx_caps_slapdamage", "10", "CAPS Punisher", "CAPS Punisher");n	register_cvar("amx_caps_obeyimmunity", 604, "CAPS Punisher", "CAPS Punisher");n	register_cvar("amx_caps_givespade", 688, "CAPS Punisher", "CAPS Punisher");n	return 0;n}nnpublic punish(_arg0)n{n	new var3;n	var3 = get_cvar_num("amx_caps_slapdamage");n	new var4 = 0;n	get_user_name(_arg0, var4, 128);n	strip_user_weapons(_arg0);n	if (get_cvar_num("amx_caps_givespade") == 0)n	{n		new var5;n		var5 = get_user_team(_arg0, {0}, "CAPS Punisher");n		if (var5 == 1)n		{n			new var1;n			if (dod_get_map_info("CAPS Punisher") == 1)n			{n				var1 = 856;n			}n			elsen			{n				var1 = 924;n			}n			give_item(_arg0, var1);n		}n		elsen		{n			new var2;n			if (var5 == 2 && dod_get_map_info(2) == 1)n			{n				give_item(_arg0, "weapon_gerknife");n			}n		}n	}n	elsen	{n		give_item(_arg0, "weapon_spade");n	}n	user_slap(_arg0, var3, 1);n	client_print("CAPS Punisher", "", "[AMXX] %s has been punished for overusing the capslock key.", var4);n	return 0;n}nnpublic say_hook(_arg0)n{n	if (!is_user_alive(_arg0))n	{n		return 0;n	}n	new var1;n	if (get_user_flags(_arg0, "CAPS Punisher") & 1 && get_cvar_num("amx_caps_obeyimmunity") == 1)n	{n		return 0;n	}n	new var3 = 0;n	new var4;n	var4 = get_cvar_num("amx_caps_minlen");n	new var5;n	var5 = float(get_cvar_num("amx_caps_minpercent"));n	read_args(var3, 256);n	new var6;n	var6 = strlen(var3) - 2;n	if (var6 < var4)n	{n		return 0;n	}n	new var7 = 0;n	new var8 = 1;n	while (var8 <= var6)n	{n		new var2;n		if (var3[var8] > 64 && var3[var8] < 91)n		{n			var7++;n		}n		var8++;n	}n	new var9;n	var9 = floatmul(1120403456, floatdiv(float(var7), float(var6)));n	if (sub_90(var9, var5))n	{n		punish(_arg0);n		return 0;n	}n	return 0;n}nnsub_90(_arg0, _arg1)n{n	return 0 <= floatcmp(_arg0, _arg1);n}nn
DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC