Checkpoint.Type

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

This Checkpoint class member returns or sets the type of the checkpoint. Checkpoint type means how it can be hit (on foot, using a vehicle...). Defaults to MARKER_TYPE_BOTH.

Syntax

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

  1. int Checkpoint.Type
  1. Checkpoint.Type = int type

Arguments

  • type - This is the new type.

Example 1. Returning

This example will message the player with the type ID for that checkpoint.

  1.  
  2. function onPlayerEnterCheckpoint( player, checkpoint )
  3. {
  4. MessagePlayer( "The current checkpoint type for this checkpoint is: " + checkpoint.Type, player );
  5. return 1;
  6. }
  7.  

Notes

The function MessagePlayer and event onPlayerEnterCheckpoint were used in this example. More info about them in the corresponding pages.

Example 2. Setting

This example will change the type of checkpoint to MARKER_TYPE_VEHICLE (only vehicles can enter it) when a player enters it.

  1.  
  2. function onPlayerEnterCheckpoint( player, checkpoint )
  3. {
  4. checkpoint.Type = MARKER_TYPE_VEHICLE;
  5. return 1;
  6. }
  7.  

Notes

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

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox