Raised This Month: $ Target: $400
 0% 

Colour text


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 06-24-2009 , 15:15   Colour text
Reply With Quote #1

Can i ask a question ?

PHP Code:
client_print(idprint_chat"[ZP] You has bought Counter Strike."
Anyone knows a way to add colour at [ZP]

PHP Code:
[ZP
__________________
ƒa†es™ is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 06-24-2009 , 15:17   Re: Colour text
Reply With Quote #2

ColorChat natives.
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
znovit
Member
Join Date: Mar 2009
Location: Behind you :=
Old 06-24-2009 , 15:59   Re: Colour text
Reply With Quote #3

#include <colorchat>

ColorChat(id, GREEN,"[ZP] ^x01You has bought Counter Strike.");

This will make the [ZP] tag green and the "You has bought Counter strike client's con_color color.
__________________

Last edited by znovit; 06-24-2009 at 16:01.
znovit is offline
MagNeto
Member
Join Date: May 2009
Old 06-24-2009 , 16:05   Re: Colour text
Reply With Quote #4

Or
Code:
client_print(id, print_chat, "^x04[ZP] ^x01You has bought Counter Strike.") 
MagNeto is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-24-2009 , 16:12   Re: Colour text
Reply With Quote #5

It will no work.
__________________
xPaw is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 06-24-2009 , 16:14   Re: Colour text
Reply With Quote #6

SayText message ->"^x04 green ^x01con_color ^x03 team_color" OR colorchat

if you want to show a red text to counter-terrorist you should use colorchat, else i would recommend writing an own little stock like this:

PHP Code:
stock chat_printplr, const message[], { FloatSqlResult}:... )
{
    static 
msg[192], saytextmaxplayers;
    
formatmsg191"^x04[ZP]^x01 " ); // (green)[ZP] (con_color)message
    
vformatmsg[7], 185message);
    
    if( !
saytext )
    {
        
saytext get_user_msgid"SayText" );
    }
    
    if( !
maxplayers )
    {
        
maxplayers get_maxplayers( );
    }

    if( 
plr <= maxplayers && plr )
    {
        
message_beginMSG_ONE_UNRELIABLEsaytext, {000}, plr );
        
write_byteplr );
        
write_stringmsg );
        
message_end( );
    }
    else if( !
plr )
    {
        for( new 
1<= maxplayersi++ )
        {
            if( !
is_user_connected) )
            {
                continue;
            }
            
            
message_beginMSG_ONE_UNRELIABLEsaytext, { 00}, );
            
write_byte);
            
write_stringmsg );
            
message_end( );
        }
    }
    
    return 
1;

__________________

Last edited by SchlumPF*; 06-24-2009 at 16:16.
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-24-2009 , 16:18   Re: Colour text
Reply With Quote #7

http://forums.alliedmods.net/showthread.php?t=94960
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 06-24-2009 , 16:21   Re: Colour text
Reply With Quote #8

Quote:
Originally Posted by ConnorMcLeod View Post
still it shouldnt be used for a case i described even though chat messages are not printed often enough to talk about efficiency!!!
__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-24-2009 , 16:23   Re: Colour text
Reply With Quote #9

Depend if he uses it in other plugins or not.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Old 07-07-2009, 10:12
ƒa†es™
This message has been deleted by ƒa†es™.
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 07-08-2009 , 03:17   Re: Colour text
Reply With Quote #10

Quote:
Originally Posted by SchlumPF* View Post
SayText message ->"^x04 green ^x01con_color ^x03 team_color" OR colorchat

if you want to show a red text to counter-terrorist you should use colorchat, else i would recommend writing an own little stock like this:

PHP Code:
stock chat_printplr, const message[], { FloatSqlResult}:... )
{
    static 
msg[192], saytextmaxplayers;
    
formatmsg191"^x04[ZP]^x01 " ); // (green)[ZP] (con_color)message
    
vformatmsg[7], 185message);
 
    if( !
saytext )
    {
        
saytext get_user_msgid"SayText" );
    }
 
    if( !
maxplayers )
    {
        
maxplayers get_maxplayers( );
    }
 
    if( 
plr <= maxplayers && plr )
    {
        
message_beginMSG_ONE_UNRELIABLEsaytext, {000}, plr );
        
write_byteplr );
        
write_stringmsg );
        
message_end( );
    }
    else if( !
plr )
    {
        for( new 
1<= maxplayersi++ )
        {
            if( !
is_user_connected) )
            {
                continue;
            }
 
            
message_beginMSG_ONE_UNRELIABLEsaytext, { 00}, );
            
write_byte);
            
write_stringmsg );
            
message_end( );
        }
    }
 
    return 
1;

I use the stock it doesn't work ? or i'm wrong.

PHP Code:
#include <amxmodx>
 
#define TIME_DELAY 1.0
#define TEXT_SAY "^x04[AMX]^x01Testing Colour." 
 
public plugin_init() 
{
        
register_plugin("Colourtext","1337","always.")
        
set_task(TIME_DELAY"Colour"0__"b")
}
 
public 
Colour()
{
        
client_print(0print_chatTEXT_SAY)
}
 
stock chat_printplr, const message[], { FloatSqlResult}:... )
{
    static 
msg[192], saytextmaxplayers;
    
formatmsg191"^x04[AMX]^x01 " );
    
vformatmsg[7], 185message);
 
    if( !
saytext )
    {
        
saytext get_user_msgid"SayText" );
    }
 
    if( !
maxplayers )
    {
        
maxplayers get_maxplayers( );
    }
 
    if( 
plr <= maxplayers && plr )
    {
        
message_beginMSG_ONE_UNRELIABLEsaytext, {000}, plr );
        
write_byteplr );
        
write_stringmsg );
        
message_end( );
    }
    else if( !
plr )
    {
        for( new 
1<= maxplayersi++ )
        {
            if( !
is_user_connected) )
            {
                continue;
            }
 
            
message_beginMSG_ONE_UNRELIABLEsaytext, { 00}, );
            
write_byte);
            
write_stringmsg );
            
message_end( );
        }
    }
 
    return 
1;

It still no colour.
__________________
ƒa†es™ 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 15:42.


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