I'm using it this way, but the color is not changed.
PHP Code:
new prefixchat[20]
Register:
PHP Code:
myvar = create_cvar("my_prefix", "^4[PREFIX]")
Pulling:
PHP Code:
get_pcvar_string(myvar, prefixchat, charsmax(prefixchat))
client_print_color(0, print_team_default, "%s", prefixchat)
If I change the color inside the game does not work.
Except if I use this stock
PHP Code:
stock xClientPrintColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
replace_all(msg, 190, "!t2", "^0")
if (id) players[0] = id; else get_players(players, count, "ch")
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i])
write_string(msg)
message_end()
}
}
}
Instead of: ^1 ^2 ^3 etc
Use: !g !t !y