Skip to content

Commit

Permalink
Merge pull request #897 from matehun00/patch-2
Browse files Browse the repository at this point in the history
Update some docs
  • Loading branch information
thorium-cfx authored Oct 30, 2023
2 parents 47b74b7 + 2287576 commit 325f44e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 13 deletions.
22 changes: 16 additions & 6 deletions CAM/AttachCamToEntity.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
27 changes: 20 additions & 7 deletions CAM/AttachCamToPedBone.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```

0 comments on commit 325f44e

Please sign in to comment.