Squirrel/Server/Functions/Checkpoints/CreateCheckpoint
From Liberty Unleashed Wiki
(Difference between revisions)
m |
|||
Line 4: | Line 4: | ||
== Syntax == | == Syntax == | ||
− | ''CreateCheckpoint'' can take | + | ''CreateCheckpoint'' can take different lists of parameters: |
<code>CreateCheckpoint( Vector pos, float radius, [ Colour col ] )</code> | <code>CreateCheckpoint( Vector pos, float radius, [ Colour col ] )</code> |
Latest revision as of 19:24, 24 September 2010
This function creates a new global checkpoint (corona) visible for everyone and returns a pointer to it. If the creation was unsuccessful, the function will return null.
[edit] Syntax
CreateCheckpoint can take different lists of parameters:
CreateCheckpoint( Vector pos, float radius, [ Colour col ] )
CreateCheckpoint( Vector pos, float radius, [ int red, int green, int blue ] )
[edit] Arguments
- pos - The position where you want the checkpoint to be created
- radius - The radius of the checkpoint to be created
- col - The colour of the checkpoint as a Colour object. If no colour is used the checkpoint will default to red
- red, green, blue - The colour of the checkpoint as separate RGB values
[edit] Example
This command will create a checkpoint at the player's location.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "cp" ) { local pos = player.Pos; CreateCheckpoint( pos, 5.0 ); } return 1; }
[edit] Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.