GetEntityAddress
Docslocal retval = GetEntityAddress(entity)Description
Experimental: This native may be altered or removed in future versions of CitizenFX without warning.
Returns the memory address of an entity.
This native is intended for singleplayer debugging, and may not be available during multiplayer.
Parameters
| Name | Type | Description |
|---|---|---|
entity | Entity | The handle of the entity to get the address of. |
Quick Snippet: Get Entityentity
entityUse this to obtain an entity handle from the player's aim or crosshair.
-- Get the entity the player is aiming at
local ped = PlayerPedId()
local hit, entity = GetEntityPlayerIsFreeAimingAt(PlayerId())
if hit and entity ~= 0 then
print("Entity: " .. entity)
print("Model: " .. GetEntityModel(entity))
print("Type: " .. GetEntityType(entity)) -- 1=Ped, 2=Vehicle, 3=Object
endReturns
Any*