Skip to content

Commit d305fc2

Browse files
committed
CA_Gag: Add debug mode with stack usage info and adjust player filtering logic
1 parent bacf1ee commit d305fc2

File tree

1 file changed

+9
-0
lines changed
  • cstrike/addons/amxmodx/scripting/ChatAdditions

1 file changed

+9
-0
lines changed

cstrike/addons/amxmodx/scripting/ChatAdditions/CA_Gag.sma

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@
1212

1313
/* ----- START SETTINGS ----- */
1414
const Float: GAG_THINKER_FREQ = 3.0
15+
// #define DEBUG
1516
/* ----- END OF SETTINGS ----- */
1617

18+
#if defined DEBUG
19+
#pragma showstackusageinfo
20+
#endif
21+
1722
static g_currentGags[MAX_PLAYERS + 1][gagData_s]
1823
static g_adminTempData[MAX_PLAYERS + 1][gagData_s]
1924
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[] = "") {
307312
for(new i; i < count; i++) {
308313
new target = players[i]
309314

315+
#if !defined DEBUG
310316
if (target == id) {
311317
continue
312318
}
319+
#endif
313320

314321
new name[MAX_NAME_LENGTH + 16]
315322
get_user_name(target, name, charsmax(name))
@@ -1067,11 +1074,13 @@ public ClCmd_Gag(const id, const level, const cid) {
10671074
return PLUGIN_HANDLED
10681075
}
10691076

1077+
#if !defined DEBUG
10701078
if (get_playersnum_ex(GetPlayers_ExcludeBots | GetPlayers_ExcludeHLTV) < 2) {
10711079
UTIL_SendAudio(id, ca_gag_sound_error)
10721080
client_print_color(id, print_team_default, "%L %L", id, "Gag_prefix", id, "Gag_NotEnoughPlayers")
10731081
return PLUGIN_HANDLED
10741082
}
1083+
#endif
10751084

10761085
MenuShow_PlayersList(id)
10771086
return PLUGIN_HANDLED

0 commit comments

Comments
 (0)