Posts: 197
Threads: 12
Joined: Oct 2015
Reputation:
0
How can i use GetPlayerColor as embedded color in the middle of the string?
I want to make local chat that keeps player's color in the message, but the "((" at the middle gets colored too.
Posts: 1,208
Threads: 36
Joined: Apr 2015
PHP код:
new buffer[256];
format(buffer,sizeof buffer,"(%d) {%06x} bla bla bla",playerid,ShiftRGBAToRGB(GetPlayerColor(playerid)));
SendClientMessageToAll(0xFFFFFFFF,buffer);
PHP код:
//RGBA to RGB
stock ShiftRGBAToRGB(color){
new r, g, b;
r = (color >>> 24);
g = (color >>> 16 & 0xFF);
b = (color >>> 8 & 0xFF);
color = (b & 0xFF) | ((g & 0xFF) << 8) | (r << 16);
return color;
}
OR
https://github.com/AbyssMorgan/SA-MP...de/SAM/RGB.inc