If you want it to allow say commands (/rs ..) to work use this.
PHP Code:
#include <amxmodx>
new bool:ChatLocked;
public plugin_init() {
register_plugin("Block Say", "1.0", "DoNii")
register_clcmd("say", "block_say")
register_clcmd("say /lock", "lock_say")
register_clcmd("say /unlock", "unlock_say")
}
public block_say(id) {
if(ChatLocked)
return PLUGIN_HANDLED_MAIN;
return PLUGIN_CONTINUE;
}
public lock_say(id) {
if(!(get_user_flags(id) & ADMIN_USER))
return PLUGIN_HANDLED;
ChatLocked = true;
client_print(0, print_chat, "Chat Is Disabled")
return PLUGIN_CONTINUE;
}
public unlock_say(id) {
if(!(get_user_flags(id) & ADMIN_USER))
return PLUGIN_HANDLED;
if(ChatLocked) {
ChatLocked = false;
client_print(0, print_chat, "Chat Is Enabled")
}
client_print(id, print_chat, "Chat Is Already Enabled")
return PLUGIN_CONTINUE;
}
Else if not, use this
PHP Code:
#include <amxmodx>
new bool:ChatLocked;
public plugin_init() {
register_plugin("Block Say", "1.0", "DoNii")
register_clcmd("say", "block_say")
register_clcmd("say /lock", "lock_say")
register_clcmd("say /unlock", "unlock_say")
}
public block_say(id) {
if(ChatLocked)
return PLUGIN_HANDLED;
return PLUGIN_CONTINUE;
}
public lock_say(id) {
if(!(get_user_flags(id) & ADMIN_USER))
return PLUGIN_HANDLED;
ChatLocked = true;
client_print(0, print_chat, "Chat Is Disabled")
return PLUGIN_CONTINUE;
}
public unlock_say(id) {
if(!(get_user_flags(id) & ADMIN_USER))
return PLUGIN_HANDLED;
if(ChatLocked) {
ChatLocked = false;
client_print(0, print_chat, "Chat Is Enabled")
}
client_print(id, print_chat, "Chat Is Already Enabled")
return PLUGIN_CONTINUE;
}
__________________