Squirrel/Server/Functions/Checkpoints/Pos

From Liberty Unleashed Wiki
Revision as of 15:51, 7 January 2010 by Force (Talk | contribs)

Jump to: navigation, search

This Checkpoint class member returns or sets the position of the given checkpoint.

Syntax

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

  1. Vector Checkpoint.Pos
  1. Checkpoint.Pos = Vector vPos

Arguments

  • vPos - This is the position of the checkpoint as a vector.

Example 1. Returning

  1.  
  2. function onPlayerFootCheckpointHit( player, checkpoint )
  3. {
  4. MessagePlayer( "The current Position of this checkpoint is: " + checkpoint.Pos, player )
  5. }
  6.  

Notes

This example will message the player with the current position of the checkpoint.

Example 2. Setting

  1.  
  2. function onPlayerFootCheckpointHit( player, checkpoint )
  3. {
  4. checkpoint.Pos = Vector( player.Pos.x + 2, player.Pos.y, player.Pos.z );
  5. }
  6.  

Notes

This example will move the checkpoint 2 x coordinates away from the player when they enter the checkpoint.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox