@@ -31,7 +31,8 @@ new ca_gag_times[64],
3131 ca_gag_remove_only_own_gag,
3232 ca_gag_sound_ok[128 ],
3333 ca_gag_sound_error[128 ],
34- bool: ca_gag_block_nickname_change
34+ bool: ca_gag_block_nickname_change,
35+ bool: ca_gag_block_admin_chat
3536
3637new g_dummy, g_itemInfo[64 ], g_itemName[128 ]
3738enum {
@@ -44,6 +45,13 @@ new g_fwd_gag_setted,
4445 g_fwd_gag_removed,
4546 g_ret
4647
48+ new const g_adminChatCmds[][] = {
49+ " amx_say" , " amx_asay" , " amx_chat" , " amx_psay" ,
50+ " amx_teamsay" , " amx_bsay" , " amx_bsay2" , " amx_csay" ,
51+ " amx_csay2" , " amx_rsay" , " amx_rsay2" , " amx_tsay" ,
52+ " amx_tsay2"
53+ }
54+
4755public stock const PluginName[] = " CA: Gag"
4856public stock const PluginVersion[] = CA_VERSION
4957public stock const PluginAuthor[] = " Sergey Shorokhov"
@@ -97,8 +105,8 @@ public plugin_init() {
97105 register_clcmd (" amx_gagmenu" , " ClCmd_Gag" , (accessFlags | accessFlagsHigh), .FlagManager = false )
98106 register_clcmd (" say" , " ClCmd_Say" , (accessFlags | accessFlagsHigh), .FlagManager = false )
99107
100- register_clcmd ( " amx_tsay " , " ClCmd_adminSay " , ADMIN_ALL )
101- register_clcmd (" amx_csay " , " ClCmd_adminSay" , ADMIN_ALL)
108+ for ( new i; i < sizeof g_adminChatCmds; i ++ )
109+ register_clcmd (g_adminChatCmds[i] , " ClCmd_adminSay" , ADMIN_CHAT);
102110
103111 CA_Log (logLevel_Debug, " [CA]: Gag initialized!" )
104112
@@ -187,6 +195,13 @@ Register_CVars() {
187195 ),
188196 ca_gag_block_nickname_change
189197 )
198+
199+ bind_pcvar_num (create_cvar (" ca_gag_block_admin_chat" , " 1" ,
200+ .description = " Also block adminchat if admin gagged\n \
201+ 0 = no restrictions"
202+ ),
203+ ca_gag_block_admin_chat
204+ )
190205}
191206
192207public client_putinserver (id) {
@@ -1263,7 +1278,7 @@ public CA_Client_ChangeName(const id, const newName[]) {
12631278
12641279public ClCmd_adminSay (const id) {
12651280 new bool: hasBlock = (g_currentGags[id][gd_reason][r_flags] & gagFlag_Say)
1266- if (! hasBlock) {
1281+ if (! hasBlock || ! ca_gag_block_admin_chat ) {
12671282 return CA_CONTINUE
12681283 }
12691284
0 commit comments