AddNavmeshBlockingObject
Docslocal retval = AddNavmeshBlockingObject(x, y, z, width, length, height, heading, bPermanent, flags)Description
Creates a navmesh blocking object, vehicles will avoid driving through this area.
Only 32 blocking objects may exist at a given time and must be manually managed. See <code>REMOVE_NAVMESH_BLOCKING_OBJECT</code> and <code>onResourceStop</code>
enum eBlockingObjectFlags {
// Default Flag
BLOCKING_OBJECT_DEFAULT = 0,
// Blocking object will block wander paths
BLOCKING_OBJECT_WANDERPATH = 1,
// Blocking object will block (regular) shortest-paths
BLOCKING_OBJECT_SHORTESTPATH = 2,
// Blocking object will block flee paths
BLOCKING_OBJECT_FLEEPATH = 4,
// Blocking object will block all paths
BLOCKING_OBJECT_ALLPATHS = 7,
}Parameters
| Name | Type | Description |
|---|---|---|
x | float | The x coordinate to create the block on. |
y | float | The y coordinate. |
z | float | The z coordinate. |
width | float | The width of the block. |
length | float | The length of the block. |
height | float | The height of the block. |
heading | float | The heading of object in degrees. |
bPermanent | BOOL | A boolean indicating if the blocking object is permanent (`true`/`false`). |
flags | int | Flag for the blocking object, refer to `eBlockingObjectFlags`. |
Quick Snippet: Get Coordinatesxyzheading
xyzheadingAdd 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
AnyReturn type varies depending on context.