GetGroundZFor_3dCoord
takes an x
, y
and z
argument, common practice is to pass a vector in other natives but doing so will cause the native to error.
According to the native ref, there is an extra unknown parameter that’s “almost always 0”.
Passing a value together with a vector will crash the game.
The crash appears to differ based on the value passed in the last argument.
Using a false value (0
or false
)
This is what is “almost always used” in decompiled scripts
Repro (using runcode):
crun GetGroundZFor_3dCoord(vector3(0.0, 0.0, 0.0), 0)
Crash Dialog:
Crash Dump:
CfxCrashDump_2020_09_15_13_18_26.zip (1.5 MB)
Using a true value (1
or true
)
Repro (using runcode):
crun GetGroundZFor_3dCoord(vector3(0.0, 0.0, 0.0), 1)
Crash Dialog:
Crash Dump:
CfxCrashDump_2020_09_15_13_31_13.zip (1.4 MB)
This is most likely not a FiveM specific issue, but I figured I’d report it since it’s easy to reproduce.
The obvious workaround is just not to use a vector as an argument.