Hello guys,
I editing bb mod but i got something is stranger, i know some codes have transformed from zombie plague but i checked zp mod and i saw the same print color codes
My problem is: When i creat a new chat and add color, the colors didn't shows but it's only showing spaces betwen the words. But if i added modname of bb mod the colors be working
can some one tell me what is the hell is this ?
Example:
Without MODNAME, Show Only Spaces:
PHP Code:
print_color(0, "[ADMIN] ^x03%s ^1take ^x04%d ^1Ammo Packs from ^x03%s", szAdminName, iAmmo, szPlayerName)
With MODNAME, Working:
PHP Code:
print_color(0, "%s [ADMIN] ^x03%s ^x01gave ^x04%d ^x01Ammo Packs to ^x03%s", MODNAME, szAdminName, iAmmo, szPlayerName)
//print color chat
PHP Code:
print_color(target, const message[], any:...)
{
static buffer[512], i, argscount
argscount = numargs()
// Send to everyone
if (!target)
{
static player
for (player = 1; player <= g_iMaxPlayers; player++)
{
// Not connected
if (!g_isConnected[player])
continue;
// Remember changed arguments
static changed[5], changedcount // [5] = max LANG_PLAYER occurencies
changedcount = 0
// Replace LANG_PLAYER with player id
for (i = 2; i < argscount; i++)
{
if (getarg(i) == LANG_PLAYER)
{
setarg(i, 0, player)
changed[changedcount] = i
changedcount++
}
}
// Format message for player
vformat(buffer, charsmax(buffer), message, 3)
// Send it
message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, player)
write_byte(player)
write_string(buffer)
message_end()
// Replace back player id's with LANG_PLAYER
for (i = 0; i < changedcount; i++)
setarg(changed[i], 0, LANG_PLAYER)
}
}
// Send to specific target
else
{
// Format message for player
vformat(buffer, charsmax(buffer), message, 3)
// Send it
message_begin(MSG_ONE, g_msgSayText, _, target)
write_byte(target)
write_string(buffer)
message_end()
}
}