From 83395c961db1b0001bfc5a3b016e318e0850e984 Mon Sep 17 00:00:00 2001 From: matehun00 <57267819+matehun00@users.noreply.github.com> Date: Fri, 21 Jul 2023 14:33:30 +0200 Subject: [PATCH 1/2] add more information and an example in lua AttachCamToPedBone --- CAM/AttachCamToPedBone.md | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/CAM/AttachCamToPedBone.md b/CAM/AttachCamToPedBone.md index 41aa9f313..547fa5386 100644 --- a/CAM/AttachCamToPedBone.md +++ b/CAM/AttachCamToPedBone.md @@ -8,13 +8,26 @@ ns: CAM void ATTACH_CAM_TO_PED_BONE(Cam cam, Ped ped, int boneIndex, float xOffset, float yOffset, float zOffset, BOOL isRelative); ``` +This native works with peds only. ## Parameters -* **cam**: -* **ped**: -* **boneIndex**: -* **xOffset**: -* **yOffset**: -* **zOffset**: -* **isRelative**: +* **cam**: The camera handle. +* **ped**: The ped handle. +* **boneIndex**: This is different to boneID, use ['GET_PED_BONE_INDEX'](#_0x3F428D08BE5AAE31) to get the index from the ID. use the index for attaching to specific bones. ```cam``` will be attached to the center of ```ped``` if bone index given doesn't correspond to bone indexes for that entity type. +* **xOffset**: X-axis offset +* **yOffset**: Y-axis offset +* **zOffset**: Z-axis offset +* **isRelative**: Whether or not the camera will be relative to the bone +## Examples + +```lua +local ped = PlayerPedId() +local cam = CreateCam("DEFAULT_SCRIPTED_CAMERA", true) + +AttachCamToPedBone(cam,ped,4089, 0.0, 0.0, 0.0, true) -- attach it to a finger on the left hand + +SetCamActive(cam, true) +RenderScriptCams(true, false, 0, true, true) + +``` From 22875765c7dbcc07ba055aaee658c03499f548f9 Mon Sep 17 00:00:00 2001 From: matehun00 <57267819+matehun00@users.noreply.github.com> Date: Fri, 21 Jul 2023 14:43:42 +0200 Subject: [PATCH 2/2] Update AttachCamToEntity.md --- CAM/AttachCamToEntity.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/CAM/AttachCamToEntity.md b/CAM/AttachCamToEntity.md index bba6209fe..d25f2cb62 100644 --- a/CAM/AttachCamToEntity.md +++ b/CAM/AttachCamToEntity.md @@ -13,10 +13,20 @@ Last param determines if its relative to the Entity ``` ## Parameters -* **cam**: -* **entity**: -* **xOffset**: -* **yOffset**: -* **zOffset**: -* **isRelative**: +* **cam**: The camera handle. +* **entity**: The entity handle. +* **xOffset**: X-axis offset +* **yOffset**: Y-axis offset +* **zOffset**: Z-axis offset +* **isRelative**: Whether or not the camera will be relative to the entity +## Examples +```lua +local entity = PlayerPedId() +local cam = CreateCam("DEFAULT_SCRIPTED_CAMERA", true) + +AttachCamToEntity(cam,entity, 0.0, 0.0, 0.0, true) --attach camera to the center of the entity + +SetCamActive(cam, true) +RenderScriptCams(true, false, 0, true, true) +```