getPlayerTargetEntity
GET_PLAYER_TARGET_ENTITY0x13EDE1A5DBF797C9The GTA V native GET_PLAYER_TARGET_ENTITY of the PLAYER namespace, as LS:MP client scripts call it: the global function getPlayerTargetEntity, in JavaScript and in Lua.
getPlayerTargetEntity(player: Player): [ok: boolean, entity: Entity]getPlayerTargetEntity(player: Player): boolean, EntityUsage
JavaScript
const [ok, entity] = getPlayerTargetEntity(player);Lua
local ok, entity = getPlayerTargetEntity(player)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
player | Player | number | integer |
Returns
2 values, in this order: an array in JavaScript, multiple return values in Lua.
| # | Value | Type | JavaScript | Lua | Description |
|---|---|---|---|---|---|
| 1 | ok | BOOL | boolean | boolean | The native’s own return value. |
| 2 | entity | Entity | number | integer | output |
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Assigns the handle of locked-on melee target to *entity that you pass it.
Returns false if no entity found.
Reference
- Namespace
- Player PLAYER
- In the game
BOOL GET_PLAYER_TARGET_ENTITY(Player player, Entity* entity)- Hash
0x13EDE1A5DBF797C9