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) +``` 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) + +```