attachEntityToEntity
ATTACH_ENTITY_TO_ENTITY0x6B9BBD38AB0796DFThe GTA V native ATTACH_ENTITY_TO_ENTITY of the ENTITY namespace, as LS:MP client scripts call it: the global function attachEntityToEntity, in JavaScript and in Lua.
attachEntityToEntity(
entity1: Entity,
entity2: Entity,
boneIndex: number,
xPos: number,
yPos: number,
zPos: number,
xRot: number,
yRot: number,
zRot: number,
p9: boolean,
useSoftPinning: boolean,
collision: boolean,
isPed: boolean,
vertexIndex: number,
fixedRot: boolean,
p15: any
): voidattachEntityToEntity(
entity1: Entity,
entity2: Entity,
boneIndex: integer,
xPos: number,
yPos: number,
zPos: number,
xRot: number,
yRot: number,
zRot: number,
p9: boolean,
useSoftPinning: boolean,
collision: boolean,
isPed: boolean,
vertexIndex: integer,
fixedRot: boolean,
p15: any
)Usage
attachEntityToEntity(
entity1, entity2, boneIndex, xPos, yPos, zPos, xRot, yRot, zRot, p9, useSoftPinning,
collision, isPed, vertexIndex, fixedRot, p15
);attachEntityToEntity(
entity1, entity2, boneIndex, xPos, yPos, zPos, xRot, yRot, zRot, p9, useSoftPinning,
collision, isPed, vertexIndex, fixedRot, p15
)Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.
attachEntityToEntity(
entity1, entity2, boneIndex, pos, rot, p9, useSoftPinning, collision, isPed, vertexIndex,
fixedRot, p15
);attachEntityToEntity(
entity1, entity2, boneIndex, pos, rot, p9, useSoftPinning, collision, isPed, vertexIndex,
fixedRot, p15
)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
entity1 | Entity | number | integer |
entity2 | Entity | number | integer |
boneIndex | int | number | integer |
xPos | float | number | number |
yPos | float | number | number |
zPos | float | number | number |
xRot | float | number | number |
yRot | float | number | number |
zRot | float | number | number |
p9 | BOOL | boolean | boolean |
useSoftPinning | BOOL | boolean | boolean |
collision | BOOL | boolean | boolean |
isPed | BOOL | boolean | boolean |
vertexIndex | int | number | integer |
fixedRot | BOOL | boolean | boolean |
p15 | Any | any | any |
Returns
Nothing. In JavaScript the call evaluates to undefined.
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Attaches entity1 to bone (boneIndex) of entity2.
boneIndex - this is different to boneID, use getPedBoneIndex to get the index from the ID. use the index for attaching to specific bones. entity1 will be attached to entity2's centre if bone index given doesn't correspond to bone indexes for that entity type.
useSoftPinning - if set to false attached entity will not detach when fixed
collision - controls collision between the two entities (FALSE disables collision).
isPed - pitch doesnt work when false and roll will only work on negative numbers (only peds)
vertexIndex - position of vertex
fixedRot - if false it ignores entity vector
Reference
- Namespace
- Entity ENTITY
- In the game
void ATTACH_ENTITY_TO_ENTITY(Entity entity1, Entity entity2, int boneIndex, float xPos, float yPos, float zPos, float xRot, float yRot, float zRot, BOOL p9, BOOL useSoftPinning, BOOL collision, BOOL isPed, int vertexIndex, BOOL fixedRot, Any p15)- Hash
0x6B9BBD38AB0796DF