PlayerClient

isPlayerRidingTrain

IS_PLAYER_RIDING_TRAIN0x4EC12697209F2196

The GTA V native IS_PLAYER_RIDING_TRAIN of the PLAYER namespace, as LS:MP client scripts call it: the global function isPlayerRidingTrain, in JavaScript and in Lua.

SignatureJavaScript
isPlayerRidingTrain(player: Player): boolean
SignatureLua
isPlayerRidingTrain(player: Player): boolean

Usage

JavaScript
const result = isPlayerRidingTrain(player);
Lua
local result = isPlayerRidingTrain(player)

Parameters

ParameterTypeJavaScriptLua
playerPlayernumberinteger

Returns

BOOL JavaScript boolean, Lua boolean

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Returns true if the player is riding a train.

Reference

Namespace
Player PLAYER
In the game
BOOL IS_PLAYER_RIDING_TRAIN(Player player)
Hash
0x4EC12697209F2196

Open in the interactive natives reference