_GET_CHECKPOINT_TRAIN_SPAWN_LOCATION
Returns a train spawn position on track trackIndex near the given coordinates.
Signature
Vector3 _GET_CHECKPOINT_TRAIN_SPAWN_LOCATION(int trackIndex, float x, float y, float z, float distance, BOOL direction); // 0x35D302397E524939 b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | trackIndex | int |
| 2 | x | float |
| 3 | y | float |
| 4 | z | float |
| 5 | distance | float |
| 6 | direction | BOOL |
Facts
| Name | _GET_CHECKPOINT_TRAIN_SPAWN_LOCATION |
|---|---|
| Hash | 0x35D302397E524939 |
| Namespace | |
| Returns | Vector3 |
| Game build | 1207 |
Examples
Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.
local coords = Citizen.InvokeNative(0x35D302397E524939, -- _GET_CHECKPOINT_TRAIN_SPAWN_LOCATION
0, -- int trackIndex
0.0, -- float x
0.0, -- float y
0.0, -- float z
0.0, -- float distance
false, -- BOOL direction
Citizen.ResultAsVector()
)
print(coords.x, coords.y, coords.z)// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const coords = Citizen.invokeNative("0x35D302397E524939", // _GET_CHECKPOINT_TRAIN_SPAWN_LOCATION
0, // int trackIndex
0.0, // float x
0.0, // float y
0.0, // float z
0.0, // float distance
false, // BOOL direction
Citizen.resultAsVector()
);
const [x, y, z] = coordsVector3 coords = Function.Call<Vector3>((Hash)0x35D302397E524939, // _GET_CHECKPOINT_TRAIN_SPAWN_LOCATION
0, // int trackIndex
0.0f, // float x
0.0f, // float y
0.0f, // float z
0.0f, // float distance
false // BOOL direction
);Related VEHICLE natives
- _GET_TRAIN_MODEL_FROM_TRAIN_CONFIG_BY_CAR_INDEX
- _GET_TRAIN_TRACK_FROM_TRAIN_VEHICLE
- _GET_CURRENT_TRACK_FOR_TRAIN
- _GET_JUNCTION_COORDS_FOR_TRAIN_TRACK
- _GET_NEAREST_TRAIN_TRACK_POSITION
- _GET_NUM_CARS_FROM_TRAIN_CONFIG
- _GET_STATION_COORDS_FROM_TRAIN_STATION_DATA
- _GET_TRAIN_CAR
- _GET_TRAIN_CARRIAGE_TRAILER_NUMBER
- _GET_TRAIN_DIRECTION
- _GET_TRAIN_DIRECTION_FROM_INDEX
- _GET_TRAIN_POSITION_ON_TRACK
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.