02.06.2016, 01:00
Well, by default the chat is like this:
(name in player's color, settable with SetPlayerColor): (what the player typed)
So technically all you need to do is set the players color to the badge color. However, you may have the player's color set to something you want separate.
If g_hDutyColour is in RGB format, you can simply send it like this in OnPlayerText:
If it's in RGBA format, you need to right shift the color (which I will not go into depth with here).
(name in player's color, settable with SetPlayerColor): (what the player typed)
So technically all you need to do is set the players color to the badge color. However, you may have the player's color set to something you want separate.
If g_hDutyColour is in RGB format, you can simply send it like this in OnPlayerText:
pawn Код:
OnPlayerText(playerid, text[]) {
SendClientMessageToAll(g_hDutyColour[playerid], text);
return 0; // so the default message isn't sent
}
pawn Код:
OnPlayerText(playerid, text[]) {
SendClientMessageToAll(g_hDutyColour[playerid] >> 8, text);
return 0; // so the default message isn't sent
}