_CREATE_MISSION_TRAIN
For more information, see trainconfigs.ymt To make the train AI controlled, set conductor to true and set the speed once.
Hash
0xC239DBD9A57D2A71Runtime name
CreateMissionTrainNamespaceVEHICLE
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
| Name | Type | Description |
|---|---|---|
configHash | Hash | — |
x | float | — |
y | float | — |
z | float | — |
direction | BOOL | — |
passengers | BOOL | — |
p6 | BOOL | — |
conductor | BOOL | — |
Returns Vehicle
Description
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
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#
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());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.InvokeNativeneeds the number — passjoaat("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. Write10.0orvalue + 0.0. The generated JS wrappers add0.0000001to 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
InvokeNativewith 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.