From 83f0e013bd32c1e57761d6d844904b9865b1fc62 Mon Sep 17 00:00:00 2001 From: rtxa Date: Tue, 6 Aug 2024 21:11:57 -0300 Subject: [PATCH] Instagib: Block selfgauss It's hardcoded because AG default configuration doesn't include this and players sometimes copypaste the gameconfigs, which isn't reliable. When we introduce gamemode_default.cfg maybe we can remove this. --- valve/addons/amxmodx/scripting/agmodx_instagib.sma | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/valve/addons/amxmodx/scripting/agmodx_instagib.sma b/valve/addons/amxmodx/scripting/agmodx_instagib.sma index 6f07429..cb37893 100644 --- a/valve/addons/amxmodx/scripting/agmodx_instagib.sma +++ b/valve/addons/amxmodx/scripting/agmodx_instagib.sma @@ -18,6 +18,8 @@ new gCvarStartWeapons[SIZE_WEAPONS]; new gCvarStartAmmo[SIZE_AMMO]; +new gCvarSelfGauss; +new gSelfGaussOldValue; public plugin_precache() { register_plugin(PLUGIN, AGMODX_VERSION, AUTHOR); @@ -31,6 +33,8 @@ public plugin_precache() { gCvarStartWeapons[i] = get_cvar_pointer(gAgStartWeapons[i]); for (new i; i < sizeof gCvarStartAmmo; i++) gCvarStartAmmo[i] = get_cvar_pointer(gAgStartAmmo[i]); + + gCvarSelfGauss = get_cvar_pointer("mp_selfgauss"); } public plugin_init() { @@ -41,6 +45,14 @@ public plugin_init() { register_clcmd("drop", "CmdDrop"); RemoveGamePlayerEquip(); + + gSelfGaussOldValue = get_pcvar_num(gCvarSelfGauss); + + set_pcvar_num(gCvarSelfGauss, 2); // Block selfgauss +} + +public plugin_end() { + set_pcvar_num(gCvarSelfGauss, gSelfGaussOldValue); } public CmdDrop() {