citizenfx/fivem

GetEntityModel server side is unreliable on RedM

Gltch3d opened this issue · 1 comments

What happened?

I was working on a resource to handle removing mission ped spawns server side when I noticed the GetEntityModel is almost entirely unreliable.

I understand this is known to be the case for objects but the same can also be said for peds.

Expected result

Return a valid model hash for the entity

Reproduction steps

AddEventHandler("entityCreating", function(entity) print('GetEntityType', GetEntityType(entity), 'GetEntityModel:', GetEntityModel(entity)) end)

It will sometimes return something that is valid in other cases it will return 0 when the entity type is 1 (peds)

704d505d15cf5916d0a80fa67434445f

Importancy

Slight inconvenience

Area(s)

RedM, FXServer, OneSync

Specific version(s)

RedM Build 1491 (Windows) | Server Build 10573 (Linux)

Additional information

Onesync is active as getting the entity from the netId works and the server can check whether it exists successfully, however the model still returns 0

It does not work for animals & objects, i've worked on PR #2044 to fix those but it still need some edits to be merged.