Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs/natives): improve description #962

Merged
merged 7 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 29 additions & 13 deletions PED/GivePedHelmet.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,35 @@ ns: PED
void GIVE_PED_HELMET(Ped ped, BOOL cannotRemove, int helmetFlag, int textureIndex);
```

```
PoliceMotorcycleHelmet 1024
RegularMotorcycleHelmet 4096
FiremanHelmet 16384
PilotHeadset 32768
PilotHelmet 65536
PsychoShock marked this conversation as resolved.
Show resolved Hide resolved
--
p2 is generally 4096 or 16384 in the scripts. p1 varies between 1 and 0.
Gives the ped a helmet. Can be removed by invoking [`REMOVE_PED_HELMET`](#0xA7B2458D0AD6DED8).

```c
enum ePedCompFlags {
PV_FLAG_NONE = 0, // 0
PV_FLAG_BULKY = 1, // 1<<0
PV_FLAG_JOB = 2, // 1<<1
PV_FLAG_SUNNY = 4, // 1<<2
PV_FLAG_WET = 8, // 1<<3
PV_FLAG_COLD = 16, // 1<<4
PV_FLAG_NOT_IN_CAR = 32, // 1<<5
PV_FLAG_BIKE_ONLY = 64, // 1<<6
PV_FLAG_NOT_INDOORS = 128, // 1<<7
PV_FLAG_FIRE_RETARDENT = 256, // 1<<8
PV_FLAG_ARMOURED = 512, // 1<<9
PV_FLAG_LIGHTLY_ARMOURED = 1024, // 1<<10
PV_FLAG_HIGH_DETAIL = 2048, // 1<<11
PV_FLAG_DEFAULT_HELMET = 4096, // 1<<12
PV_FLAG_RANDOM_HELMET = 8192, // 1<<13
PV_FLAG_SCRIPT_HELMET = 16384, // 1<<14
PV_FLAG_FLIGHT_HELMET = 32768, // 1<<15
PV_FLAG_HIDE_IN_FIRST_PERSON = 65536, // 1<<16
PV_FLAG_USE_PHYSICS_HAT_2 = 131072, // 1<<17
PV_FLAG_PILOT_HELMET = 262144 // 1<<18
};
```

## Parameters
* **ped**:
* **cannotRemove**:
* **helmetFlag**:
* **textureIndex**:

* **ped**: Ped index.
* **cannotRemove**: Can remove helmet or not.
* **helmetFlag**: Flag for the helmet, the helmet appearance depends on the ped it's being applied on.
* **textureIndex**: Texture index; any value other than `-1` will overwrite the default texture index. The helmet texture index needs to be valid for it to be applied.
20 changes: 11 additions & 9 deletions PED/IsAnyPedShootingInArea.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ ns: PED

```c
// 0xA0D3D71EA1086C55 0x91833867
BOOL IS_ANY_PED_SHOOTING_IN_AREA(float x1, float y1, float z1, float x2, float y2, float z2, BOOL p6, BOOL p7);
BOOL IS_ANY_PED_SHOOTING_IN_AREA(float minX, float minY, float minZ, float maxX, float maxY, float maxZ, BOOL bHighlightArea, BOOL bDo3DCheck);
```

Verifies whether a ped is firing within a specific area.

## Parameters
* **x1**:
* **y1**:
* **z1**:
* **x2**:
* **y2**:
* **z2**:
* **p6**:
* **p7**:
* **minX**: Minimum X vector
* **minY**: Minimum Y vector
* **minZ**: Minimum Z vector
* **maxX**: Maximum X vector
* **maxY**: Maximum Y vector
* **maxZ**: Maximum Z vector
* **bHighlightArea**: Highlights the area to check when set to `true`.
* **bDo3DCheck**: Conducts a 3D height check when set to `true`.

## Return value
`true` if a ped is within the defined area, `false` otherwise.
7 changes: 2 additions & 5 deletions PED/IsPedInCombat.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ ns: PED
BOOL IS_PED_IN_COMBAT(Ped ped, Ped target);
```

```
Checks to see if ped and target are in combat with eachother. Only goes one-way: if target is engaged in combat with ped but ped has not yet reacted, the function will return false until ped starts fighting back.
p1 is usually 0 in the scripts because it gets the ped id during the task sequence. For instance: PED::IS_PED_IN_COMBAT(l_42E[4/*14*/], PLAYER::PLAYER_PED_ID()) // armenian2.ct4: 43794
```
Examines whether the ped is engaged in combat; when given a target ped index, it confirms if the ped is actively fighting the specified target, returning true if engaged and false if not.

## Parameters
* **ped**:
* **ped**: Ped index.
* **target**:

## Return value
3 changes: 2 additions & 1 deletion PED/IsPedTryingToEnterALockedVehicle.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ ns: PED
BOOL IS_PED_TRYING_TO_ENTER_A_LOCKED_VEHICLE(Ped ped);
```

If the ped is attempting to enter a locked vehicle.

## Parameters
* **ped**:
* **ped**: Ped index.

## Return value
5 changes: 3 additions & 2 deletions PED/RemovePedHelmet.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ ns: PED
void REMOVE_PED_HELMET(Ped ped, BOOL instantly);
```

Remove a helmet from a ped

## Parameters
* **ped**:
* **instantly**:
* **ped**: Ped index.
* **instantly**: Force to remove.

21 changes: 12 additions & 9 deletions PED/SetPedCombatRange.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ ns: PED

```c
// 0x3C606747B23E497B 0x8818A959
void SET_PED_COMBAT_RANGE(Ped ped, int p1);
void SET_PED_COMBAT_RANGE(Ped ped, int range);
```

```
Only the values 0, 1 and 2 occur in the decompiled scripts. Most likely refers directly to the values also described as AttackRange in combatbehaviour.meta:
0: CR_Near
1: CR_Medium
2: CR_Far
Define the scope within which the ped will engage in combat with the target.

```c
enum eCombatRange {
CR_NEAR = 0, // keeps within 5-15m
CR_MEDIUM, // keeps within 7-30m
CR_FAR, // keeps within 15-40m
CR_VERY_FAR // keeps within 22-45m
};
```

## Parameters
* **ped**:
* **p1**:

* **ped**: Ped index
* **range**: See `eCombatRange` enum.
8 changes: 4 additions & 4 deletions PED/SetPedHelmet.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ ns: PED

```c
// 0x560A43136EB58105 0xED366E53
void SET_PED_HELMET(Ped ped, BOOL canWearHelmet);
void SET_PED_HELMET(Ped ped, BOOL bEnable);
```

Sets whether a pedestrian should wear a helmet.

## Parameters
* **ped**:
* **canWearHelmet**:

* **ped**: Ped index.
* **bEnable**: Boolean value that indicates whether the helmet should be worn or not.
6 changes: 3 additions & 3 deletions PED/SetPedShootsAtCoord.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ ns: PED
void SET_PED_SHOOTS_AT_COORD(Ped ped, float x, float y, float z, BOOL toggle);
```

Fires a weapon at a coordinate using a ped.

## Parameters
* **ped**:
* **ped**: Ped index.
* **x**:
* **y**:
* **z**:
* **toggle**:

* **toggle**:
5 changes: 2 additions & 3 deletions PED/WasPedKilledByStealth.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ ns: PED
BOOL WAS_PED_KILLED_BY_STEALTH(Ped ped);
```

Verifies whether ped was eliminated through stealth.

## Parameters
* **ped**:

## Return value
* **ped**: Ped index
4 changes: 2 additions & 2 deletions SYSTEM/Settimera.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ns: SYSTEM
void SETTIMERA(int value);
```

Sets the value for the timer A in milliseconds

## Parameters
* **value**:

* **value**: In milliseconds.
4 changes: 2 additions & 2 deletions SYSTEM/Settimerb.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ns: SYSTEM
void SETTIMERB(int value);
```

Sets the value for the timer B in milliseconds

## Parameters
* **value**:

* **value**: In milliseconds.
Loading