RedM Natives

_CREATE_MISSION_TRAIN

For more information, see trainconfigs.ymt To make the train AI controlled, set conductor to true and set the speed once.

Hash0xC239DBD9A57D2A71
Runtime nameCreateMissionTrain
NamespaceVEHICLE
SideClient
NameCommunity guess
Docs
Since build1207

Signature

Vehicle _CREATE_MISSION_TRAIN(Hash configHash, float x, float y, float z, BOOL direction, BOOL passengers, BOOL p6, BOOL conductor);

Parameters

NameTypeDescription
configHashHash—
xfloat—
yfloat—
zfloat—
directionBOOL—
passengersBOOL—
p6BOOL—
conductorBOOL—

Returns Vehicle

Description

alloc8or RDR3 NativeDB

configHash: https://alloc8or.re/rdr3/doc/enums/eTrainConfig.txt
For more information, see trainconfigs.ymt
To make the train AI controlled, set conductor to true and set the speed once.

femga rdr3_discoveries · research notes

0xc239dbd9a57d2a71 (By Smallos)

N_0xc239dbd9a57d2a71(trainHash, GetEntityCoords(PlayerPedId()), 0, 0, 1, 1)
It's for trains
Will automatically spawn a train on the closest tracks to the coords specified.

Usage

Lua
local retval = CreateMissionTrain(configHash, x, y, z, direction, passengers, p6, conductor)

-- always works, by hash
local retval = Citizen.InvokeNative(0xC239DBD9A57D2A71, configHash, x, y, z, direction, passengers, p6, conductor, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = CreateMissionTrain(configHash, x, y, z, direction, passengers, p6, conductor);

// by hash
const retval = Citizen.invokeNative('0xC239DBD9A57D2A71', configHash, x + 0.0000001, y + 0.0000001, z + 0.0000001, direction, passengers, p6, conductor, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
int retval = Function.Call<int>((Hash)0xC239DBD9A57D2A71, configHash, x, y, z, direction, passengers, p6, conductor);
  • Hash parameters: the named function also accepts a string and hashes it for you; Citizen.InvokeNative needs the number — pass joaat("name") or a backtick literal like `name`.
  • Float parameters: Lua integers (10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write 10.0 or value + 0.0. The generated JS wrappers add 0.0000001 to non-zero floats for the same reason.
  • The name is a community guess and may change. If the named call is missing in your client build, use InvokeNative with the hash — it always works.

See also

Sources

alloc8or RDR3 NativeDB · femga rdr3_discoveries

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.