fivem icon indicating copy to clipboard operation
fivem copied to clipboard

DoesEntityExist, HasEntityBeenMarkedForDeletion issues

Open mcNuggets1 opened this issue 1 month ago • 2 comments

What happened?

DoesEntityExist returns false in entityRemoved and HasEntityBeenMarkedForDeletion errors with invalid entities. It would be nice if HasEntityBeenMarkedForDeletion wouldnt error so it would have a use.

Expected result

A function checking if something exists should never expect the thing to exist and error if it doesnt. HasBeenMarkedForDeletion does that however. Which makes checking in entityRemoved for validity IMPOSSIBLE.

Reproduction steps

Theres no workaround...

Importancy

Slight inconvenience

Area(s)

FiveM

Specific version(s)

FiveM

Additional information

No response

mcNuggets1 avatar Nov 15 '25 08:11 mcNuggets1

There is a situation where DoesEntityExist returns false, while HasEntityBeenMarkedForDeletion returns 1. But there is no reliable way to call the function as it errors.

mcNuggets1 avatar Nov 15 '25 09:11 mcNuggets1

NetworkDoesEntityExistWithNetworkId doesnt work for sv

mcNuggets1 avatar Nov 15 '25 10:11 mcNuggets1