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 , 13:20   Re: [HELP] use ColorChat
Reply With Quote #1

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 #2

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 #3

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 #4

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 #5

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 #6

Quote:
Originally Posted by OciXCrom View Post
redivcram 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 22:17.


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