IsEntityInAngledArea
Docslocal retval = IsEntityInAngledArea(entity, x1, y1, z1, x2, y2, z2, width, debug, includez, p10)Description
p10 is some entity flag check, also used in <code>IS_ENTITY_AT_ENTITY</code>, <code>IS_ENTITY_IN_AREA</code> and <code>IS_ENTITY_AT_COORD</code>.
See <code>IS_POINT_IN_ANGLED_AREA</code> for the definition of an angled area.
Parameters
| Name | Type | Description |
|---|---|---|
entity | Entity | — |
x1 | float | X dimension of the angled area 'origin' |
y1 | float | Y dimension of the angled area 'origin' |
z1 | float | Z dimension of the angled area 'origin' |
x2 | float | X dimension of the angled area 'extent' |
y2 | float | Y dimension of the angled area 'extent' |
z2 | float | Z dimension of the angled area 'extent' |
width | float | Width of the angled area |
debug | BOOL | a debug flag invoking functions in the same path as `DRAW_MARKER` |
includez | BOOL | If true, include the Z dimension when doing the height check; otherwise the query becomes two-dimensional |
p10 | Any | — |
Quick Snippet: Get Coordinatesx1y1z1x2
x1y1z1x2Add this command to your client script to retrieve precise locations in-game.
-- Add this to your client.lua. Type /pos in-game to copy coords.
RegisterCommand('pos', function()
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
local heading = GetEntityHeading(ped)
local output = string.format("vector4(%.2f, %.2f, %.2f, %.2f)", coords.x, coords.y, coords.z, heading)
print(output)
TriggerEvent('chat:addMessage', { args = { '^4[COORD]^0', output } })
end)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
BOOLReturns TRUE (1) or FALSE (0).