Squirrel/Client/Functions/Players/Train

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|Player.Train}} {{Squirrel/LUOnly}} {{ScriptingChangesIn0.1.0.11}} This ''Player'' class member returns the train the player is in or ''INVALID_TRAIN_ID'' if the …')
 

Latest revision as of 23:23, 12 September 2011

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.

[edit] Syntax

  1. int Player.Train

[edit] Arguments

  • none

[edit] 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.  

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox