Blip.Pos

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This Blip class member returns or sets the position of the blip on the radar.

Syntax

You can either return or set a new value using this member:

  1. Vector Blip.Pos
  1. Blip.Pos = Vector newPos

Arguments

  • newPos - A vector representing the new position of the blip.

Example 1. Returning the value

This example command prints the position of blip ID 0 on screen when someone types '/blippos'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "blippos" )
  5. {
  6. local pBlip = FindBlip( 0 );
  7. local vPos = pBlip.Pos;
  8. if ( pBlip ) MessagePlayer( "Blip ID 0 is at pos - " + vPos.x + ", " + vPos.y, pPlayer );
  9. }
  10. return 1;
  11. }
  12.  

Notes

The functions FindBlip, MessagePlayer and event onPlayerCommand were used in this example. More info about them in the corresponding pages.

Example 2. Setting a new value

This example command will move blip ID 0 to player's position when they type '/setblippos'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "setblippos" )
  5. {
  6. local pBlip = FindBlip( 0 );
  7. if ( pBlip ) pBlip.Pos = pPlayer.Pos;
  8. }
  9. return 1;
  10. }
  11.  

Notes

The functions FindBlip, Player.Pos and event onPlayerCommand were used in this example. More info about them in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox