Embedding GetPlayerColor
#1

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.
Reply
#2

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 
rgb;
    
= (color >>> 24);
    
= (color >>> 16 0xFF);
    
= (color >>> 0xFF);
    
color = (0xFF) | ((0xFF) << 8) | (<< 16);
    return 
color;

OR
https://github.com/AbyssMorgan/SA-MP...de/SAM/RGB.inc
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)