StartShapeTestBox
Docslocal retval = StartShapeTestBox(x, y, z, x1, y1, z1, rotX, rotY, rotZ, p9, flags, entity, p12)Description
For more information, see <code>START_EXPENSIVE_SYNCHRONOUS_SHAPE_TEST_LOS_PROBE</code> and <code>START_SHAPE_TEST_LOS_PROBE</code>.
Parameters
| Name | Type | Description |
|---|---|---|
x | float | Starting X coordinate. |
y | float | Starting Y coordinate. |
z | float | Starting Z coordinate. |
x1 | float | Ending X coordinate. |
y1 | float | Ending Y coordinate. |
z1 | float | Ending Z coordinate. |
rotX | float | — |
rotY | float | — |
rotZ | float | — |
p9 | int | Unknown, always 2 or 0 |
flags | int | See [`START_SHAPE_TEST_LOS_PROBE`](#\_0x7EE9F5D83DD4F90E) |
entity | Entity | — |
p12 | int | A bit mask with bits 1, 2, 4, or 7 relating to collider types. 4 and 7 are usually used. |
Quick Snippet: Get Coordinatesxyzx1
xyzx1Add 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
intReturns an integer value.