AttachEntityToEntityPhysically
DocsAttachEntityToEntityPhysically(entity1, entity2, boneIndex1, boneIndex2, xPos1, yPos1, zPos1, xPos2, yPos2, zPos2, xRot, yRot, zRot, breakForce, fixedRot, p15, collision, teleport, p18)Description
breakForce is the amount of force required to break the bond.
p14 - is always 1 in scripts
p15 - is 1 or 0 in scripts - unknown what it does
p16 - controls collision between the two entities (FALSE disables collision).
p17 - do not teleport entity to be attached to the position of the bone Index of the target entity (if 1, entity will not be teleported to target bone)
p18 - is always 2 in scripts.
Parameters
| Name | Type | Description |
|---|---|---|
entity1 | Entity | — |
entity2 | Entity | — |
boneIndex1 | int | — |
boneIndex2 | int | — |
xPos1 | float | — |
yPos1 | float | — |
zPos1 | float | — |
xPos2 | float | — |
yPos2 | float | — |
zPos2 | float | — |
xRot | float | — |
yRot | float | — |
zRot | float | — |
breakForce | float | — |
fixedRot | BOOL | — |
p15 | BOOL | — |
collision | BOOL | — |
teleport | BOOL | — |
p18 | int | — |
Quick Snippet: Get CoordinatesxRotyRotzRot
xRotyRotzRotAdd 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 Entityentity1entity2
entity1entity2Use 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
voidThis native does not return a value.