#if defined _colored_print_included
#endinput
#endif
#define _colored_print_included
colored_print(target, const message[], any:...)
{
static buffer[512], i, argscount
argscount = numargs()
if (!target)
{
static player
for (player = 1; player <= get_maxplayers(); player++)
{
if (!is_user_connected(player))
continue;
static changed[5], changedcount // [5] = max LANG_PLAYER occurencies
changedcount = 0
for (i = 2; i < argscount; i++)
{
if (getarg(i) == LANG_PLAYER)
{
setarg(i, 0, player)
changed[changedcount] = i
changedcount++
}
}
vformat(buffer, charsmax(buffer), message, 3)
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, player)
write_byte(player)
write_string(buffer)
message_end()
for (i = 0; i < changedcount; i++)
setarg(changed[i], 0, LANG_PLAYER)
}
}
else
{
vformat(buffer, charsmax(buffer), message, 3)
message_begin(MSG_ONE, get_user_msgid("SayText"), _, target)
write_byte(target)
write_string(buffer)
message_end()
}
}