Squirrel/Server/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 …')

Revision as of 23:19, 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.

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

Template:Squirrel/Functions/Players

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox