Raised This Month: $ Target: $400
 0% 

[SOLVED] use ColorChat


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Banana.
BANNED
Join Date: Oct 2015
Location: Brazil [<o>]
Old 10-11-2015 , 17:29   Re: [HELP] use ColorChat
Reply With Quote #9

PHP Code:
public cmdSayAdmin(id)
{
    
    new 
said[2]
    
read_argv(1said1)
    if (
said[0] != '@')
        return 
PLUGIN_CONTINUE
    
new message[192], name[32], authid[32]
    new 
players[32], inum
    read_args
(message191)
    
remove_quotes(message)
    
get_user_authid(idauthid31)
    
get_user_name(idname31)
    if(
get_user_flags(id) & ADMIN_CHAT)
        
client_print_color(id"[* ADMINS *] ^x04%s:  %s"namemessage[1])
    else
        
client_print_color(id"[* PLAYER *] ^x01%s:  %s"namemessage[1])
    
get_players(playersinum)
    for (new 
0inum; ++i)
    {
        
// dont print the message to the client that used the cmd if he has ADMIN_CHAT to avoid double printing
        
if (players[i] != id && get_user_flags(players[i]) & g_AdminChatFlag)
            
Colorchat(players[i], GREY"%s"message)
    }
    
Colorchat(idGREY"%s"message)
    return 
PLUGIN_HANDLED
    
}

stock client_print_color(const id, const input[], any:...)  
{  
    new 
count 1players[32];  
    static 
msg[191];  
    
vformat(msg190input3);  

    
replace_all(msg190"!g""^x04"); // Green Color  
    
replace_all(msg190"!n""^x01"); // Default Color  
    
replace_all(msg190"!t""^x03"); // Team Color  

    
if (idplayers[0] = id; else get_players(playerscount"ch");  
    {  
        for (new 
0counti++)  
        {  
            if (
is_user_connected(players[i]))  
            {  
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);  
                
write_byte(players[i]);  
                
write_string(msg);  
                
message_end();  
            }  
        }  
    }  


Last edited by Banana.; 10-11-2015 at 17:29.
Banana. 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 22:17.


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