_GET_TRAIN_TRACK_JUNCTION_AT_COORDS
Outputs junctionIndex, to be used with 0xE6C5E2125EB210C1.
Hash
0x86AFC343CF7F0B34Runtime name
GetTrainTrackJunctionAtCoordsNamespaceVEHICLE
SideClient
NameCommunity guess
Docs
Since build1207
Signature
BOOL _GET_TRAIN_TRACK_JUNCTION_AT_COORDS(Hash trainTrack, float x, float y, float z, int* junctionIndex);Parameters
| Name | Type | Description |
|---|---|---|
trainTrack | Hash | — |
x | float | — |
y | float | — |
z | float | — |
junctionIndex | int* | — |
Returns BOOL
Description
Outputs junctionIndex, to be used with 0xE6C5E2125EB210C1.
trainTrack: see 0x09034479E6E3E269.
Usage
local retval, junctionIndex = GetTrainTrackJunctionAtCoords(trainTrack, x, y, z, junctionIndex)
-- always works, by hash
local retval, junctionIndex = Citizen.InvokeNative(0x86AFC343CF7F0B34, trainTrack, x, y, z, Citizen.PointerValueIntInitialized(junctionIndex), Citizen.ReturnResultAnyway())JavaScript and C#
const [retval, junctionIndex] = GetTrainTrackJunctionAtCoords(trainTrack, x, y, z, junctionIndex);
// by hash
const [retval, junctionIndex] = Citizen.invokeNative('0x86AFC343CF7F0B34', trainTrack, x + 0.0000001, y + 0.0000001, z + 0.0000001, Citizen.pointerValueIntInitialized(junctionIndex), Citizen.returnResultAnyway());var junctionIndex = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x86AFC343CF7F0B34, trainTrack, x, y, z, junctionIndex);
// junctionIndex.GetResult<int>()- 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 last argument is an in/out pointer: pass its initial value, and the updated value is returned after the result.
- 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.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.