Player.Train

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events
LU This function works in Liberty Unleashed only.

This Player class member returns the train the player is in or INVALID_TRAIN_ID if the player is not travelling on a train.

Syntax

  1. int Player.Train

Arguments

  • none

Example

This example command tells player which train theyre riding when they type '/train'.

  1.  
  2. function onClientCommand( cmd, text )
  3. {
  4. if ( cmd == "train" )
  5. {
  6. Message( "Your current train is train ID: " + FindLocalPlayer().Train );
  7. }
  8. return 1;
  9. }
  10.  

Notes

The functions Message, FindLocalPlayer and call onClientCommand were used in this example. More info about them can be found in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox