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 onClientCommand( cmd, text ) { if ( cmd == "train" ) { Message( "Your current train is train ID: " + FindLocalPlayer().Train ); } return 1; }
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
- FindLocalPlayer
- FindPlayer
- Player.Angle
- Player.Armour
- Player.Cash
- Player.Class
- Player.Colour
- Player.Frozen
- Player.Health
- Player.ID
- Player.Immune
- Player.Island
- Player.Marker
- Player.Name
- Player.Ping
- Player.Pos
- Player.RemoveLimb
- Player.Score
- Player.Skin
- Player.Spawn
- Player.Team
- Player.Train
- Player.Vehicle
- Player.Velocity
- Player.VirtualWorld
- Player.WantedLevel
- Player.Weapon
- Player.WeaponAmmo
- Player.WeaponState