EntityClientNot in this build

getNearestParticipantToEntity

GET_NEAREST_PARTICIPANT_TO_ENTITY0xFFBD7052D65BE0FF

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

SignatureJavaScript
getNearestParticipantToEntity(entity: Entity): number
SignatureLua
getNearestParticipantToEntity(entity: Entity): integer
⚠
Not in this game build

The global exists, but the native is not part of the game build LS:MP runs: calling it does nothing and returns undefined in JavaScript, nil in Lua. It never throws. See Coverage.

Usage

JavaScript
const result = getNearestParticipantToEntity(entity);
Lua
local result = getNearestParticipantToEntity(entity)

Parameters

ParameterTypeJavaScriptLua
entityEntitynumberinteger

Returns

int JavaScript number, Lua integer

Reference

Namespace
Entity ENTITY
In the game
int GET_NEAREST_PARTICIPANT_TO_ENTITY(Entity entity)
Hash
0xFFBD7052D65BE0FF
Introduced
Game build 2944 legacy numbering

Open in the interactive natives reference