SetPlayerMarkerForPlayer
#5

Quote:

// Make the players marker invisible to the player while keeping chat colour the same.
SetPlayerMarkerForPlayer( 42, 1, ( [b]GetPlayerColor( 1 ) & 0xFFFFFF00 ) );

// Make the players marker fully opaque (solid) to the player while keeping chat colour the same.
SetPlayerMarkerForPlayer( 42, 1, ([b] GetPlayerColor( 1 ) | 0x000000FF ) );

It does what the comments say.
The first line:
Код:
GetPlayerColor( 1 ) & 0xFFFFFF00
Takes the player's color and does a bitwise AND with 0xFFFFFF00.
This keeps the RGB (red, green, blue) part of the player's color but makes the Alpha (the last "00") 0, making the player's dot on the radar completely transparent.
If the player's color was 0x00FF00FF (green and full alpha), the color is set to 0x00FF0000 after this.

The second line:
Код:
GetPlayerColor( 1 ) | 0x000000FF
Takes the player's color and does a bitwise OR with 0x000000FF.
This keeps the player's color and sets the alpha to "FF", no matter what the alpha value of the player was before.
The player's dot will be fully opaque (non-transparent).
If the player's color was 0x00FF0000 (green and no alpha), the color is set to 0x00FF00FF after this.
Reply


Messages In This Thread
[SOLVED by PowerPC603] SetPlayerMarkerForPlayer - by Nameless303 - 29.12.2010, 13:36
Re: SetPlayerMarkerForPlayer - by TopAz07 - 29.12.2010, 15:07
Re: SetPlayerMarkerForPlayer - by Nameless303 - 29.12.2010, 15:31
Re: SetPlayerMarkerForPlayer - by Nero_3D - 29.12.2010, 17:09
Re: SetPlayerMarkerForPlayer - by PowerPC603 - 29.12.2010, 18:01
Re: SetPlayerMarkerForPlayer - by Nameless303 - 29.12.2010, 19:22

Forum Jump:


Users browsing this thread: 1 Guest(s)