Raised This Month: $ Target: $400
 0% 

[SOLVED] use ColorChat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 10-11-2015 , 11:56   [SOLVED] use ColorChat
Reply With Quote #1

hi guys how to use ColorChat here

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)
            
client_print(players[i], print_chat"%s"message)
    }
    
client_print(idprint_chat"%s"message)
    return 
PLUGIN_HANDLED
    

here
PHP Code:
 if(get_user_flags(id) & ADMIN_CHAT)
        
format(message191"[* ADMINS *] %s:  %s"namemessage[1])
    else
        
format(message191"[* PLAYER *] %s:  %s"namemessage[1]) 
i wrote
PHP Code:
    if(get_user_flags(id) & ADMIN_CHAT)
        
ColorChat(messageGREY191"^4[* ADMINS *] %s:  %s"namemessage[1])
    else
        
ColorChat(messageGREY191"^4[* PLAYER *] %s:  %s"namemessage[1]) 
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
but i have problem with compile :/
help me plz

Last edited by arvEL.; 10-28-2015 at 23:26.
arvEL. is offline
Send a message via Skype™ to arvEL.
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 10-11-2015 , 13:20   Re: [HELP] use ColorChat
Reply With Quote #2

What does it say?

PHP Code:
 if(get_user_flags(id) & ADMIN_CHAT)
        
format(message191"[* ADMINS *] %s:  %s"namemessage[1])
    else
        
format(message191"[* PLAYER *] %s:  %s"namemessage[1]) 
It says format. Colorchat is a replacement for client_print native, not format.

What you should be replacing here would be these lines.

PHP Code:
 client_print(players[i], print_chat"%s"message)
    }
    
client_print(idprint_chat"%s"message
PHP Code:
 Colorchat(players[i], GREY"%s"message)
    }
    
Colorchat(idGREY"%s"message
__________________
Spirit_12 is offline
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 10-11-2015 , 14:18   Re: [HELP] use ColorChat
Reply With Quote #3

Quote:
Originally Posted by Spirit_12 View Post
What does it say?

PHP Code:
 if(get_user_flags(id) & ADMIN_CHAT)
        
format(message191"[* ADMINS *] %s:  %s"namemessage[1])
    else
        
format(message191"[* PLAYER *] %s:  %s"namemessage[1]) 
It says format. Colorchat is a replacement for client_print native, not format.

What you should be replacing here would be these lines.

PHP Code:
 client_print(players[i], print_chat"%s"message)
    }
    
client_print(idprint_chat"%s"message
PHP Code:
 Colorchat(players[i], GREY"%s"message)
    }
    
Colorchat(idGREY"%s"message
Thx bro but can you fix my codes
and give me full codes
arvEL. is offline
Send a message via Skype™ to arvEL.
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 10-11-2015 , 14:21   Re: [HELP] use ColorChat
Reply With Quote #4

That was the fixed code. This is where that piece fits in.

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
    

__________________
Spirit_12 is offline
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 10-11-2015 , 15:11   Re: [HELP] use ColorChat
Reply With Quote #5

Quote:
Originally Posted by Spirit_12 View Post
That was the fixed code. This is where that piece fits in.

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
    

sorry not work :/
you should be fix this

PHP Code:
    if(get_user_flags(id) & ADMIN_CHAT)
        
format(message191"[* ADMINS *] %s:  %s"namemessage[1])
    else
        
format(message191"[* PLAYER *] %s:  %s"namemessage[1]) 
arvEL. is offline
Send a message via Skype™ to arvEL.
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-11-2015 , 14:19   Re: [HELP] use ColorChat
Reply With Quote #6

Simple tutorial - https://youtu.be/xhyHNEK1TbU
OciXCrom is offline
Send a message via Skype™ to OciXCrom
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 10-24-2015 , 17:15   Re: [HELP] use ColorChat
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
redivcram is offline
Adomaz1
Senior Member
Join Date: Feb 2014
Old 10-11-2015 , 15:52   Re: [HELP] use ColorChat
Reply With Quote #8

just give the compiling error...
Adomaz1 is offline
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
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 10-11-2015 , 19:33   Re: [HELP] use ColorChat
Reply With Quote #10

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();  
            }  
        }  
    }  

thx bro but i want use ColorChat because it have a GREY color!
see 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
thx bro i wish you help me bro
arvEL. is offline
Send a message via Skype™ to arvEL.
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