Player.Alpha

From Liberty Unleashed Wiki
Revision as of 00:43, 17 November 2010 by Juppi (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This Player class variable sets/returns the alpha of the player ped. Note that this settings does not affect weapons or special skins.

Syntax

  1. int player.Alpha
  1. player.Alpha = int alpha

Arguments

  • alpha - The alpha value you wish to set (0...255)

Example 1. Returning

This example will let the player know their current alpha setting when they type '/getalpha'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "getalpha" )
  5. {
  6. MessagePlayer( "Your alpha state is currently set to " + pPlayer.Alpha, pPlayer );
  7. }
  8. return 1;
  9. }
  10.  

Notes

The function MessagePlayer and event onPlayerCommand were used in this example. More info about them can be found in the corresponding pages.

Example 2. Setting

This example will set the player almost completely transparent when they type '/ghost'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "ghost" )
  5. {
  6. pPlayer.Alpha = 10;
  7. }
  8. return 1;
  9. }
  10.  

Notes

The event onPlayerCommand was used in in this example. More info about this in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox