Raised This Month: $ Target: $400
 0% 

[SOLVED] use ColorChat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 10-11-2015 , 22:35   Re: [HELP] use ColorChat
Reply With Quote #1

Quote:
Originally Posted by Banana. View Post
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();  
            }  
        }  
    }  

Why would you change the format with client_print_color? Like I said before, client_print_color, and Colorchat are the replacements for print_chat native not format.

Also, why add the stock at the bottom, when its clear that op is using Colorchat include, which holds the stock code?
__________________

Last edited by Spirit_12; 10-11-2015 at 22:36.
Spirit_12 is offline
Banana.
BANNED
Join Date: Oct 2015
Location: Brazil [<o>]
Old 10-11-2015 , 17:32   Re: [HELP] use ColorChat
Reply With Quote #2

What you are really trying to do?

If chatcolor , try this: https://forums.alliedmods.net/showthread.php?p=556619
Banana. is offline
Banana.
BANNED
Join Date: Oct 2015
Location: Brazil [<o>]
Old 10-11-2015 , 21:04   Re: [HELP] use ColorChat
Reply With Quote #3

Ok guy
I will try to do this for you.

Last edited by Banana.; 10-11-2015 at 21:07.
Banana. is offline
Banana.
BANNED
Join Date: Oct 2015
Location: Brazil [<o>]
Old 10-11-2015 , 22:39   Re: [HELP] use ColorChat
Reply With Quote #4

He chooses the easiest way to use the code , did it to set an example , I thought he was going to use fewer colors .
Banana. is offline
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 10-24-2015 , 16:24   Re: [HELP] use ColorChat
Reply With Quote #5

Up....
arvEL. is offline
Send a message via Skype™ to arvEL.
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 10-24-2015 , 23:05   Re: [HELP] use ColorChat
Reply With Quote #6

@redivcram man please read my posts again
arvEL. is offline
Send a message via Skype™ to arvEL.
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-25-2015 , 05:47   Re: [HELP] use ColorChat
Reply With Quote #7

You're the one who's not reading. Could you please explain what is the problem with using the way I suggested?
OciXCrom is offline
Send a message via Skype™ to OciXCrom
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 10-25-2015 , 05:59   Re: [HELP] use ColorChat
Reply With Quote #8

arvEL.

I've read your posts and thought that you might didn't see ocixcrom's post.
Don't be so lazy and expect other people to do everything for you. You can watch the tutorial and make brackets, prefixes or whatever you want multicolored as you wanted.
redivcram is offline
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 10-25-2015 , 11:42   Re: [HELP] use ColorChat
Reply With Quote #9

@redivcram @OciXCrom guys please i'm not lazy and i'm not stupid
i tired from trying but not work i need edit this lines
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)
        
format(message191"[* ADMINS *] %s:  %s"namemessage[1])
    else
        
format(message191"[* PLAYER *] %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
    

Example:
[* ADMINS *] arvEL.-: Hi all

[* *] = Yellow color
ADMINS = Green color
arvEL.- = Grey color
Hi all = Yellow color

^1[*^4 ADMINS ^1*]^3 %s^1: %s
i hope you understand my meaning
arvEL. is offline
Send a message via Skype™ to arvEL.
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-25-2015 , 13:22   Re: [HELP] use ColorChat
Reply With Quote #10

So just replace them?!

PHP Code:
format(message191"^1[*^4 ADMINS ^1*]^3 %s^1: %s"namemessage[1]) 
What's the problem?! Try removing the * symbols.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 22:17.


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