Player.Train

From Liberty Unleashed Wiki
Revision as of 18:27, 15 January 2012 by SugarD (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "train" )
  5. {
  6. MessagePlayer( "Your current train is train ID: " + player.Train, player );
  7. }
  8. return 1;
  9. }
  10.  

Notes

The function MessagePlayer and call onPlayerCommand were used in this example. More info about them can be found in corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox