Here is a stock:
PHP Code:
// Prints chat in colours
// use !g for green color
// use !t for team color [Team color can be red ,blue or grey, It depends on players team]
// use !y for yellow color
stock client_colored_print(const id, const input[], any:...)
{
new iCount = 1, iPlayers[32]
static szMsg[191]
vformat(szMsg, charsmax(szMsg), input, 3)
replace_all(szMsg, 190, "!g", "^4") // green txt
replace_all(szMsg, 190, "!y", "^1") // orange txt
replace_all(szMsg, 190, "!t", "^3") // team txt
if(id) iPlayers[0] = id
else get_players(iPlayers, iCount, "ch")
for (new i = 0; i < iCount; i++)
{
if (is_user_connected(iPlayers[i]))
{
message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
write_byte(iPlayers[i])
write_string(szMsg)
message_end()
}
}
}
Usage:
PHP Code:
client_colored_print( id, "!gHy , !t Bye ")
__________________