EntityClient

setEntityAsNoLongerNeeded

SET_ENTITY_AS_NO_LONGER_NEEDED0xB736A491E64A32CF

The GTA V native SET_ENTITY_AS_NO_LONGER_NEEDED of the ENTITY namespace, as LS:MP client scripts call it: the global function setEntityAsNoLongerNeeded, in JavaScript and in Lua.

SignatureJavaScript
setEntityAsNoLongerNeeded(entity: Entity): void
SignatureLua
setEntityAsNoLongerNeeded(entity: Entity)
⚠
Known issue

The value of entity does not reach the game yet: LS:MP currently treats this pointer as an output, so the game receives an empty value instead of yours.

Usage

JavaScript
setEntityAsNoLongerNeeded(entity);
Lua
setEntityAsNoLongerNeeded(entity)

Parameters

ParameterTypeJavaScriptLua
entityEntitynumberinteger

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Marks the specified entity (ped, vehicle or object) as no longer needed if its population type is set to the mission type.
If the entity is ped, it will also clear their tasks immediately just like when clearPedTasksImmediately is called.
Entities marked as no longer needed, will be deleted as the engine sees fit.

Reference

Namespace
Entity ENTITY
In the game
void SET_ENTITY_AS_NO_LONGER_NEEDED(Entity* entity)
Hash
0xB736A491E64A32CF

Open in the interactive natives reference