Player.Train
From Liberty Unleashed Wiki
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
int Player.Train
Arguments
- none
Example
This example command tells player which train theyre riding when they type '/train'.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "train" ) { MessagePlayer( "Your current train is train ID: " + player.Train, player ); } return 1; }
Notes
The function MessagePlayer and call onPlayerCommand were used in this example. More info about them can be found in corresponding pages.