From d305fc2c6b834cf394a2442e4313cf90d6e9dccd Mon Sep 17 00:00:00 2001 From: Nord1cWarr1or Date: Tue, 9 Dec 2025 23:40:32 +0300 Subject: [PATCH] CA_Gag: Add debug mode with stack usage info and adjust player filtering logic --- .../addons/amxmodx/scripting/ChatAdditions/CA_Gag.sma | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cstrike/addons/amxmodx/scripting/ChatAdditions/CA_Gag.sma b/cstrike/addons/amxmodx/scripting/ChatAdditions/CA_Gag.sma index 8190764..e6594ca 100644 --- a/cstrike/addons/amxmodx/scripting/ChatAdditions/CA_Gag.sma +++ b/cstrike/addons/amxmodx/scripting/ChatAdditions/CA_Gag.sma @@ -12,8 +12,13 @@ /* ----- START SETTINGS ----- */ const Float: GAG_THINKER_FREQ = 3.0 +// #define DEBUG /* ----- END OF SETTINGS ----- */ +#if defined DEBUG + #pragma showstackusageinfo +#endif + static g_currentGags[MAX_PLAYERS + 1][gagData_s] static g_adminTempData[MAX_PLAYERS + 1][gagData_s] static bool: g_inEditMenu[MAX_PLAYERS + 1] // HACK: need for transmit data per menus @@ -307,9 +312,11 @@ static MenuShow_PlayersList(const id, const nickname[] = "") { for(new i; i < count; i++) { new target = players[i] + #if !defined DEBUG if (target == id) { continue } + #endif new name[MAX_NAME_LENGTH + 16] get_user_name(target, name, charsmax(name)) @@ -1067,11 +1074,13 @@ public ClCmd_Gag(const id, const level, const cid) { return PLUGIN_HANDLED } + #if !defined DEBUG if (get_playersnum_ex(GetPlayers_ExcludeBots | GetPlayers_ExcludeHLTV) < 2) { UTIL_SendAudio(id, ca_gag_sound_error) client_print_color(id, print_team_default, "%L %L", id, "Gag_prefix", id, "Gag_NotEnoughPlayers") return PLUGIN_HANDLED } + #endif MenuShow_PlayersList(id) return PLUGIN_HANDLED