@@ -73,7 +73,7 @@ public plugin_precache() {
7373 register_dictionary (" time.txt" )
7474
7575 register_srvcmd (" ca_gag_add_reason" , " SrvCmd_AddReason" )
76- register_srvcmd (" ca_gag_show_templates" , " SrvCmd_ShowTemplates" );
76+ register_srvcmd (" ca_gag_show_templates" , " SrvCmd_ShowTemplates" )
7777 register_srvcmd (" ca_gag_reload_config" , " SrvCmd_ReloadConfig" )
7878
7979 Create_CVars ()
@@ -114,7 +114,7 @@ public plugin_init() {
114114 register_clcmd (" amx_gagmenu" , " ClCmd_Gag" , (accessFlags | accessFlagsHigh), .FlagManager = false )
115115
116116 for (new i; i < sizeof g_adminChatCmds; i++ )
117- register_clcmd (g_adminChatCmds[i], " ClCmd_adminSay" , ADMIN_CHAT);
117+ register_clcmd (g_adminChatCmds[i], " ClCmd_adminSay" , ADMIN_CHAT)
118118
119119 CA_Log (logLevel_Debug, " [CA]: Gag initialized!" )
120120
@@ -363,6 +363,7 @@ public MenuHandler_PlayersList(const id, const menu, const item) {
363363 }
364364
365365 menu_item_getinfo (menu, item, g_dummy, g_itemInfo, charsmax (g_itemInfo), g_itemName, charsmax (g_itemName), g_dummy)
366+ menu_destroy (menu)
366367
367368 new userID = strtol (g_itemInfo)
368369
@@ -373,7 +374,6 @@ public MenuHandler_PlayersList(const id, const menu, const item) {
373374 client_print_color (id, print_team_red, " % L % L" , id, " Gag_prefix" , id, " Gag_PlayerNotConnected" )
374375
375376 MenuShow_PlayersList (id)
376- menu_destroy (menu)
377377 return PLUGIN_HANDLED
378378 }
379379
@@ -384,15 +384,13 @@ public MenuHandler_PlayersList(const id, const menu, const item) {
384384 g_adminTempData[id][gd_target] = target
385385
386386 MenuShow_ShowGag (id)
387- menu_destroy (menu)
388387 return PLUGIN_HANDLED
389388 }
390389
391390 // Setup gag for target player
392391 GagData_GetPersonalData (id, target, g_adminTempData[id])
393392
394393 MenuShow_SelectReason (id)
395- menu_destroy (menu)
396394 return PLUGIN_HANDLED
397395}
398396
@@ -494,13 +492,12 @@ public MenuHandler_SelectReason(const id, const menu, const item) {
494492 }
495493
496494 menu_item_getinfo (menu, item, g_dummy, g_itemInfo, charsmax (g_itemInfo), g_itemName, charsmax (g_itemName), g_dummy)
495+ menu_destroy (menu)
497496
498497 new reasonID = strtol (g_itemInfo)
499498
500499 if (reasonID == ITEM_ENTER_GAG_REASON) {
501500 client_cmd (id, " messagemode enter_GagReason" )
502-
503- menu_destroy (menu)
504501 return PLUGIN_HANDLED
505502 }
506503
@@ -513,29 +510,22 @@ public MenuHandler_SelectReason(const id, const menu, const item) {
513510 // Time not set
514511 if (reason[r_time] == 0 ) {
515512 MenuShow_SelectTime (id)
516-
517- menu_destroy (menu)
518513 return PLUGIN_HANDLED
519514 }
520515
521516 if (g_inEditMenu[id]) {
522517 MenuShow_EditGag (id)
523-
524- menu_destroy (menu)
525518 return PLUGIN_HANDLED
526519 }
527520
528521 if (reason[r_flags] == gagFlag_Removed) {
529522 MenuShow_SelectFlags (id)
530-
531- menu_destroy (menu)
532523 return PLUGIN_HANDLED
533524 }
534525
535526 Gag_Save (id, target, reason[r_time], reason[r_flags])
536527 GagData_Reset (g_adminTempData[id])
537528
538- menu_destroy (menu)
539529 return PLUGIN_HANDLED
540530}
541531
@@ -606,13 +596,12 @@ public MenuHandler_SelectTime(const id, const menu, const item) {
606596 }
607597
608598 menu_item_getinfo (menu, item, g_dummy, g_itemInfo, charsmax (g_itemInfo), g_itemName, charsmax (g_itemName), g_dummy)
599+ menu_destroy (menu)
609600
610601 new timeID = strtol (g_itemInfo)
611602
612603 if (timeID == ITEM_ENTER_GAG_TIME) {
613604 client_cmd (id, " messagemode enter_GagTime" )
614-
615- menu_destroy (menu)
616605 return PLUGIN_HANDLED
617606 }
618607
@@ -621,13 +610,10 @@ public MenuHandler_SelectTime(const id, const menu, const item) {
621610
622611 if (g_inEditMenu[id]) {
623612 MenuShow_EditGag (id)
624- menu_destroy (menu)
625-
626613 return PLUGIN_HANDLED
627614 }
628615
629616 MenuShow_SelectFlags (id)
630- menu_destroy (menu)
631617 return PLUGIN_HANDLED
632618}
633619
@@ -740,6 +726,8 @@ public MenuHandler_SelectFlags(const id, const menu, const item) {
740726 }
741727
742728 menu_item_getinfo (menu, item, g_dummy, g_itemInfo, charsmax (g_itemInfo), g_itemName, charsmax (g_itemName), g_dummy)
729+ menu_destroy (menu)
730+
743731 new itemIndex = strtol (g_itemInfo)
744732
745733 switch (itemIndex) {
@@ -757,13 +745,11 @@ public MenuHandler_SelectFlags(const id, const menu, const item) {
757745 Gag_Save (id, target, time, flags, expireAt)
758746 GagData_Reset (g_adminTempData[id])
759747
760- menu_destroy (menu)
761748 return PLUGIN_HANDLED
762749 }
763750 }
764751
765752 MenuShow_SelectFlags (id)
766- menu_destroy (menu)
767753 return PLUGIN_HANDLED
768754}
769755
@@ -855,10 +841,10 @@ public MenuCallback_ShowGag(const id, const menu, const item) {
855841public MenuHandler_ShowGag (const id, const menu, const item) {
856842 enum { menu_ComfirmRemove, menu_EditGagProperties }
857843
844+ menu_destroy (menu)
845+
858846 if (item == MENU_EXIT || item < 0 ) {
859847 MenuShow_PlayersList (id)
860-
861- menu_destroy (menu)
862848 return PLUGIN_HANDLED
863849 }
864850
@@ -869,7 +855,6 @@ public MenuHandler_ShowGag(const id, const menu, const item) {
869855 client_print_color (id, print_team_red, " % L % L" , id, " Gag_prefix" , id, " Gag_PlayerNotConnected" )
870856
871857 MenuShow_PlayersList (id)
872- menu_destroy (menu)
873858 return PLUGIN_HANDLED
874859 }
875860
@@ -878,7 +863,6 @@ public MenuHandler_ShowGag(const id, const menu, const item) {
878863 Gag_Remove (id, target)
879864
880865 MenuShow_PlayersList (id)
881- menu_destroy (menu)
882866 return PLUGIN_HANDLED
883867 }
884868
@@ -897,12 +881,10 @@ public MenuHandler_ShowGag(const id, const menu, const item) {
897881 g_inEditMenu[id] = true
898882
899883 MenuShow_EditGag (id)
900- menu_destroy (menu)
901884 return PLUGIN_HANDLED
902885 }
903886
904887 MenuShow_PlayersList (id)
905- menu_destroy (menu)
906888 return PLUGIN_HANDLED
907889}
908890
@@ -1028,8 +1010,9 @@ public MenuHandler_EditGag(const id, const menu, const item) {
10281010 return PLUGIN_HANDLED
10291011 }
10301012
1031-
10321013 menu_item_getinfo (menu, item, g_dummy, g_itemInfo, charsmax (g_itemInfo), g_itemName, charsmax (g_itemName), g_dummy)
1014+ menu_destroy (menu)
1015+
10331016 new itemIndex = strtol (g_itemInfo)
10341017
10351018 switch (itemIndex) {
@@ -1038,8 +1021,6 @@ public MenuHandler_EditGag(const id, const menu, const item) {
10381021 case gagFlag_Voice: g_adminTempData[id][gd_reason][r_flags] ^= gagFlag_Voice
10391022 case ITEM_REASON: {
10401023 MenuShow_SelectReason (id)
1041-
1042- menu_destroy (menu)
10431024 return PLUGIN_HANDLED
10441025 }
10451026 case ITEM_CONFIRM: {
@@ -1063,13 +1044,11 @@ public MenuHandler_EditGag(const id, const menu, const item) {
10631044 GagData_Reset (g_adminTempData[id])
10641045 g_inEditMenu[id] = false
10651046
1066- menu_destroy (menu)
10671047 return PLUGIN_HANDLED
10681048 }
10691049 }
10701050
10711051 MenuShow_EditGag (id)
1072- menu_destroy (menu)
10731052 return PLUGIN_HANDLED
10741053}
10751054/*
@@ -1328,7 +1307,7 @@ public CA_Client_Voice(const listener, const sender) {
13281307
13291308public CA_Client_Say (id, const bool: isTeamMessage, const message[]) {
13301309 if (CmdRouter (id, message))
1331- return PLUGIN_CONTINUE
1310+ return CA_CONTINUE
13321311
13331312 new bool: hasBlock
13341313 if (isTeamMessage) {
@@ -1574,9 +1553,9 @@ static Get_GagFlags_Names(gag_flags_s: flags) {
15741553 if (ca_gag_common_chat_block && (flags & gagFlag_SayTeam))
15751554 flags ^= gagFlag_SayTeam
15761555
1577- for (new i = 0 ; i < sizeof (GAG_FLAGS_STR); i++ ) {
1556+ for (new i; i < sizeof (GAG_FLAGS_STR); i++ ) {
15781557 if (flags & gag_flags_s: (1 << i)) {
1579- strcat (buffer, fmt (" %s + " , GAG_FLAGS_STR[i]), charsmax (buffer));
1558+ strcat (buffer, fmt (" %s + " , GAG_FLAGS_STR[i]), charsmax (buffer))
15801559 }
15811560 }
15821561
0 commit comments