GET_NEAREST_PLAYER_TO_ENTITY
Returns the player nearest to the entity, optionally ignoring a given player ped.
Signature
Player GET_NEAREST_PLAYER_TO_ENTITY(Entity entity, Ped playerPedToIgnore, int flags); // 0x990E294FC387FB88 b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | entity | Entity |
| 2 | playerPedToIgnore | Ped |
| 3 | flags | int |
Facts
| Name | GET_NEAREST_PLAYER_TO_ENTITY |
|---|---|
| Hash | 0x990E294FC387FB88 |
| Namespace | |
| Returns | Player |
| Game build | 1207 |
Examples
Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.
local player = Citizen.InvokeNative(0x990E294FC387FB88, -- GET_NEAREST_PLAYER_TO_ENTITY
PlayerPedId(), -- Entity entity
PlayerPedId(), -- Ped playerPedToIgnore
0, -- int flags
Citizen.ResultAsInteger()
)
print(player)const player = Citizen.invokeNative("0x990E294FC387FB88", // GET_NEAREST_PLAYER_TO_ENTITY
PlayerPedId(), // Entity entity
PlayerPedId(), // Ped playerPedToIgnore
0, // int flags
Citizen.resultAsInteger()
);
console.log(player)int player = Function.Call<int>((Hash)0x990E294FC387FB88, // GET_NEAREST_PLAYER_TO_ENTITY
API.PlayerPedId(), // Entity entity
API.PlayerPedId(), // Ped playerPedToIgnore
0 // int flags
);Related ENTITY natives
- GET_NEAREST_PLAYER_TO_ENTITY_ON_TEAM
- GET_NEAREST_PARTICIPANT_TO_ENTITY
- _GET_LAST_ENTITY_TO_DAMAGE_ENTITY
- GET_ENTITY_ATTACHED_TO
- ATTACH_ENTITY_TO_ENTITY
- ATTACH_ENTITY_TO_ENTITY_PHYSICALLY
- HAS_ENTITY_CLEAR_LOS_TO_ENTITY
- HAS_ENTITY_CLEAR_LOS_TO_ENTITY_IN_FRONT
- IS_ENTITY_ATTACHED_TO_ENTITY
- GET_CARRIABLE_ENTITY_STATE
- GET_ENTITY_ALPHA
- GET_ENTITY_BONE_INDEX_BY_NAME
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.