Raised This Month: $ Target: $400
 0% 

[REQ] Admin can write dots


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PandaDnB
Senior Member
Join Date: Jan 2012
Old 12-22-2012 , 11:15   [REQ] Admin can write dots
Reply With Quote #1

Hello, I have this code that blocks dots in the chat. Can someone make it so that admins with flag "d" can write dots?
PHP Code:
#include <amxmodx>

public plugin_init() {
    
register_clcmd("say""CmdSay"); 
    
register_clcmd("say_team""CmdSay");
}

public 
CmdSay(id) { 
    new 
args[192]; 
    
read_args(argscharsmax(args)); 
    
remove_quotes(args); 
    if(
containi(args".") != -1) { 
            
client_print(idprint_chat"[Prefix] Your message cannot contain dot (.)!"
            return 
PLUGIN_HANDLED;
    }   
    return 
PLUGIN_CONTINUE


Last edited by PandaDnB; 12-22-2012 at 11:15.
PandaDnB is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 12-22-2012 , 11:57   Re: [REQ] Admin can write dots
Reply With Quote #2

PHP Code:
#include <amxmodx>

public plugin_init() {
    
register_clcmd("say""CmdSay"); 
    
register_clcmd("say_team""CmdSay");
}

public 
CmdSay(id) { 
    if( 
get_user_flags(id) & read_flags("d") )
        return 
PLUGIN_CONTINUE

    
new args[192]; 
    
read_args(argscharsmax(args)); 
    
remove_quotes(args); 
    if(
containi(args".") != -1) { 
        
client_print(idprint_chat"[Prefix] Your message cannot contain dot (.)!"
        return 
PLUGIN_HANDLED;
    }   
    return 
PLUGIN_CONTINUE

__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
PandaDnB
Senior Member
Join Date: Jan 2012
Old 12-22-2012 , 12:48   Re: [REQ] Admin can write dots
Reply With Quote #3

Thank you.
PandaDnB is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-22-2012 , 14:25   Re: [REQ] Admin can write dots
Reply With Quote #4

Don't use read_flags() since you have no reason to use it. It just one more native to execute.
__________________
fysiks is offline
PandaDnB
Senior Member
Join Date: Jan 2012
Old 12-22-2012 , 14:31   Re: [REQ] Admin can write dots
Reply With Quote #5

PHP Code:
#include <amxmodx>

public plugin_init() { 
    
register_clcmd("say""CmdSay");  
    
register_clcmd("say_team""CmdSay"); 


public 
CmdSay(id) {  
    if( 
get_user_flags(id) & ADMIN_LEVEL_BAN 
        return 
PLUGIN_CONTINUE 

    
new args[192];  
    
read_args(argscharsmax(args));  
    
remove_quotes(args);  
    if(
containi(args".") != -1) {
        
client_print(idprint_chat"[Prefix] Your message cannot contain dot (.)!")  
        return 
PLUGIN_HANDLED
    }    
    return 
PLUGIN_CONTINUE;  

Like this?

Last edited by PandaDnB; 12-22-2012 at 14:32.
PandaDnB is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-22-2012 , 14:34   Re: [REQ] Admin can write dots
Reply With Quote #6

Quote:
Originally Posted by PandaDnB View Post
PHP Code:
#include <amxmodx>

public plugin_init() { 
    
register_clcmd("say""CmdSay");  
    
register_clcmd("say_team""CmdSay"); 


public 
CmdSay(id) {  
    if( 
get_user_flags(id) & ADMIN_LEVEL_BAN 
        return 
PLUGIN_CONTINUE 

    
new args[192];  
    
read_args(argscharsmax(args));  
    
remove_quotes(args);  
    if(
containi(args".") != -1) {
        
client_print(idprint_chat"[Prefix] Your message cannot contain dot (.)!")  
        return 
PLUGIN_HANDLED
    }    
    return 
PLUGIN_CONTINUE;  

Like this?
Yeah but you have to use one that exists.
__________________
fysiks is offline
PandaDnB
Senior Member
Join Date: Jan 2012
Old 12-22-2012 , 14:35   Re: [REQ] Admin can write dots
Reply With Quote #7

Oops, you mean ADMIN_BAN right ?
PandaDnB is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 12-22-2012 , 15:14   Re: [REQ] Admin can write dots
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
Don't use read_flags() since you have no reason to use it. It just one more native to execute.
I used it because I didn't remmeber what ADMIN_ define is flag d
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-22-2012 , 15:32   Re: [REQ] Admin can write dots
Reply With Quote #9

Quote:
Originally Posted by pokemonmaster View Post
I used it because I didn't remmeber what ADMIN_ define is flag d
Then you just look it up in amxconst.inc
__________________
fysiks is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 12-22-2012 , 15:51   Re: [REQ] Admin can write dots
Reply With Quote #10

Quote:
Originally Posted by fysiks View Post
Then you just look it up in amxconst.inc
I was lazy.
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
Reply



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:07.


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