05.06.2011, 14:44
Hi.
How to check it ?
Thanks!
How to check it ?
Thanks!
SetPlayerColor( playerid, COLOR_BLACK );
if( GetPlayerColor( playerid ) == COLOR_BLACK ) {
SendClientMessage( playerid, -1, "Your color is black (no racist :p). " );
}
stock hex2rgba(hex,&r,&g,&b,&a) r = (hex >> 24) & 0x000000FF, g = (hex >> 16) & 0x000000FF, b = (hex >> 8) & 0x000000FF, a = hex & 0x000000FF;
public OnPlayerSpawn(playerid)
{
new r, g, b, a;
rgba2hex(GetPlayerColor(playerid),r,g,b,a);
if(r == 0 && g == 0 && b == 0) // Black is R=0 B=0 G=0
{
// ...
}
}