d0p3t / fivem-js

Javascript and Typescript wrapper for the FiveM natives API
https://d0p3t.nl
Other
143 stars 57 forks source link

[BUG] Character not hydrated when looping. #63

Closed ryanhaticus closed 3 years ago

ryanhaticus commented 3 years ago

I'm looping through players like so,

for (const player of Cfx.Game.playerList())

and I find that the player.Character portion is not hydrated with the correct values. The only value that seems to be correct is the handle. Other values, such as Position and IsInvincible, are not correct.

Any input? It's much appreciated.

ryanhaticus commented 3 years ago

Mind the confusion. Not a bug. The IsInvincible name is rather misleading and is actually a setter. No getter exists for entities, only players.

Perhaps this can be corrected in the future, but I am not sure if FiveM even provides this type of endpoint.