JS Native function work differently than Lua ones

I have an issue with one native function ( GetWaypointCoords 0x29B30D07C3F7873B ). It output a different value compared to Lua.

Lua :

print(GetWaypointCoords())
--- output : [100,500,10] (vector3)

JS :

console.log(Citizen.invokeNative('0x29B30D07C3F7873B'));
// output : -1018342930 (hash of something ???)

I don’t know how many natives function are not fully implemented in JavaScript compared to C# and Lua. It’s discouraging to see that Natives bindings can be different depending on the language you use. I don’t want to drop the speed of development than JS offer compared to C#, or the great ecosystem compared to LUA.

Why are you comparing a wrapper to directly invoking the function by hash, and then drawing weird conclusions from this incorrect initial proposition?

The following are equivalent (and wrong, as you’re not adding return type annotations):

print(Citizen.InvokeNative(0x29B30D07C3F7873B))
console.log(Citizen.invokeNative('0x29B30D07C3F7873B'));

These are equivalent and correct:

print(GetWaypointCoords())
console.log(GetWaypointCoords());

Well, this is indeed my fault.

The javascript GayWaypointCoords is not defined by the@citizenfx/client npm package, and my previous attempt to call any undefined (or defined) functions often trigger an error. That’s why I prefer to call Native function.

But shouldn’t the native function and the wrapper function provide the same result ?

That’s also explain a lot of strange things happening in my code. Well, thank you for helping me on this thing, you saved me some hours I believe.

This is for FiveM, not RedM.

Yes, as long as you pass the same arguments as the wrapper.