IsPointInAngledArea
Docslocal retval = IsPointInAngledArea(xPos, yPos, zPos, x1, y1, z1, x2, y2, z2, width, p10, includez)Description
An angled area is an X-Z oriented rectangle with three parameters:
1. origin: the mid-point along a base edge of the rectangle;
2. extent: the mid-point of opposite base edge on the other Z;
3. width: the length of the base edge; (named derived from logging strings CNetworkRoadNodeWorldStateData).
The oriented rectangle can then be derived from the direction of the two points (norm(origin - extent)), its orthonormal, and the width, e.g:
Parameters
| Name | Type | Description |
|---|---|---|
xPos | float | The x coordinate. |
yPos | float | The y coordinate. |
zPos | float | The z coordinate. |
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 |
p10 | 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 |
Quick Snippet: Get CoordinatesxPosyPoszPosx1
xPosyPoszPosx1Add 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)Returns
BOOLReturns TRUE (1) or FALSE (0).