Squirrel/Server/Functions/Checkpoints/CreateClientCheckpoint

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|CreateClientCheckpoint}} This function creates a new local checkpoint (corona) visible for one player only and returns a pointer to it. If the creation was unsuc…')
 

Latest revision as of 19:28, 24 September 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function creates a new local checkpoint (corona) visible for one player only and returns a pointer to it. If the creation was unsuccessful, the function will return null.

[edit] Syntax

CreateClientCheckpoint can take 3 different lists of parameters:

  1. CreateClientCheckpoint( Vector pos, float radius, Player plr )
  1. CreateClientCheckpoint( Vector pos, float radius, Colour col, Player plr )
  1. CreateClientCheckpoint( Vector pos, float radius, int red, int green, int blue, Player plr )

[edit] Arguments

  • pos - The position where you want the checkpoint to be created
  • radius - The radius of the checkpoint to be created
  • plr - The owner of this checkpoint (the player who will be able to see it)
  • 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 blue checkpoint at the player's location.

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "cp" )
  5. {
  6. local pos = player.Pos;
  7. CreateClientCheckpoint( pos, 5.0, Colour( 0, 0, 255 ), player );
  8. }
  9. return 1;
  10. }
  11.  

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox