Raised This Month: $ Target: $400
 0% 

Can somebody help :/ ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-12-2017 , 12:48   Re: Can somebody help :/ ?
Reply With Quote #9

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(0print_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(0print_chat"Chat Is Enabled")
    }
    
    
client_print(idprint_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(0print_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(0print_chat"Chat Is Enabled")
    }
    
    
client_print(idprint_chat"Chat Is Already Enabled")
    return 
PLUGIN_CONTINUE;

__________________

Last edited by edon1337; 02-12-2017 at 12:51.
edon1337 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:03.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode