getNearestPlayerToEntityOnTeam
GET_NEAREST_PLAYER_TO_ENTITY_ON_TEAM0x4DC9A62F844D9337The GTA V native GET_NEAREST_PLAYER_TO_ENTITY_ON_TEAM of the ENTITY namespace, as LS:MP client scripts call it: the global function getNearestPlayerToEntityOnTeam, in JavaScript and in Lua.
getNearestPlayerToEntityOnTeam(entity: Entity, team: number): PlayergetNearestPlayerToEntityOnTeam(entity: Entity, team: integer): PlayerUsage
JavaScript
const player = getNearestPlayerToEntityOnTeam(entity, team);Lua
local player = getNearestPlayerToEntityOnTeam(entity, team)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
entity | Entity | number | integer |
team | int | number | integer |
Returns
Player JavaScript number, Lua integerThe game's own player index: a local slot, as playerId() returns it. Not an LS:MP playerId.
Reference
- Namespace
- Entity ENTITY
- In the game
Player GET_NEAREST_PLAYER_TO_ENTITY_ON_TEAM(Entity entity, int team)- Hash
0x4DC9A62F844D9337