If you use ^x04 or any other colors like that in the ML file, you will have to fix them with the plugin.
Code:
FixMLColor( const szKey[ ], szFixedKey[ ], const iFixedKeyLen )
{
static const szReplaces[ ][ 2 ][ ] =
{
{ "^^x04", "^4" },
{ "^^x03", "^3" },
{ "^^x01", "^1" },
{ "^^4", "^4" },
{ "^^3", "^3" },
{ "^^1", "^1" },
{ "!g", "^4" },
{ "!t", "^3" },
{ "!y", "^1" }
};
copy( szFixedKey, iFixedKeyLen, szKey );
for( new i = 0; i < sizeof( szReplaces ); i++ )
{
replace_all( szFixedKey, iFixedKeyLen, szReplaces[ i ][ 0 ], szReplaces[ i ][ 1 ] );
}
return strlen( szFixedKey );
}
Language file:
Code:
[en]
SUCKEST_MAP = ^x04The suckest map is: ^x03%s
-- or --
SUCKEST_MAP = ^4The suckest map is: ^3%s
-- or --
SUCKEST_MAP = !gThe suckest map is: !t%s
Usage:
Code:
new szMessage[ 192 ];
formatex( szMessage, charsmax( szMessage ), "%L", id, "SUCKEST_MAP", szMap );
FixMLColor( szMessage, szMessage, charsmax( szMessage ) );
message_begin( MSG_ONE, g_iMsgID_SayText, _, id );
write_byte( id );
write_string( szMessage );
message_end( );
__________________