|
Senior Member
Join Date: May 2009
Location: Garena
|

07-08-2009
, 03:17
Re: Colour text
|
#10
|
Quote:
Originally Posted by SchlumPF*
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_print( plr, const message[], { Float, Sql, Result, _ }:... ) { static msg[192], saytext, maxplayers; format( msg, 191, "^x04[ZP]^x01 " ); // (green)[ZP] (con_color)message vformat( msg[7], 185, message, 3 ); if( !saytext ) { saytext = get_user_msgid( "SayText" ); } if( !maxplayers ) { maxplayers = get_maxplayers( ); } if( plr <= maxplayers && plr ) { message_begin( MSG_ONE_UNRELIABLE, saytext, {0, 0, 0}, plr ); write_byte( plr ); write_string( msg ); message_end( ); } else if( !plr ) { for( new i = 1; i <= maxplayers; i++ ) { if( !is_user_connected( i ) ) { continue; } message_begin( MSG_ONE_UNRELIABLE, saytext, { 0, 0, 0 }, i ); write_byte( i ); write_string( msg ); 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(0, print_chat, TEXT_SAY) } stock chat_print( plr, const message[], { Float, Sql, Result, _ }:... ) { static msg[192], saytext, maxplayers; format( msg, 191, "^x04[AMX]^x01 " ); vformat( msg[7], 185, message, 3 ); if( !saytext ) { saytext = get_user_msgid( "SayText" ); } if( !maxplayers ) { maxplayers = get_maxplayers( ); } if( plr <= maxplayers && plr ) { message_begin( MSG_ONE_UNRELIABLE, saytext, {0, 0, 0}, plr ); write_byte( plr ); write_string( msg ); message_end( ); } else if( !plr ) { for( new i = 1; i <= maxplayers; i++ ) { if( !is_user_connected( i ) ) { continue; } message_begin( MSG_ONE_UNRELIABLE, saytext, { 0, 0, 0 }, i ); write_byte( i ); write_string( msg ); message_end( ); } } return 1; }
It still no colour.
__________________
|
|