Skip to content

Commit

Permalink
Clarify usage for weapon capacity natives
Browse files Browse the repository at this point in the history
This PR renames the weapon capacity natives to match the original names
and also clarifies where these weapon indexes are meant to be found.
  • Loading branch information
colistro123 committed Oct 24, 2024
1 parent 9690545 commit bd5e91f
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 34 deletions.
17 changes: 0 additions & 17 deletions VEHICLE/GetVehicleWeaponCapacity.md

This file was deleted.

18 changes: 18 additions & 0 deletions VEHICLE/GetVehicleWeaponRestrictedAmmo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
ns: VEHICLE
aliases: ["0x8181CE2F25CB9BB7", "_GET_VEHICLE_WEAPON_CAPACITY"]
---
## GET_VEHICLE_WEAPON_RESTRICTED_AMMO

```c
// 0x8181CE2F25CB9BB7
int GET_VEHICLE_WEAPON_RESTRICTED_AMMO(Vehicle vehicle, int weaponIndex);
```
## Parameters
* **vehicle**: The vehicle handle
* **weaponIndex**: The weapon index we're getting ammo for (see [SET_VEHICLE_WEAPON_RESTRICTED_AMMO](#_0x44CD1F493DB2A0A6) for information on how to access these slots).
## Return value
Gets the current restricted ammo count for a particular vehicle weapon index on a vehicle.
17 changes: 0 additions & 17 deletions VEHICLE/SetVehicleWeaponCapacity.md

This file was deleted.

29 changes: 29 additions & 0 deletions VEHICLE/SetVehicleWeaponRestrictedAmmo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
ns: VEHICLE
aliases: ["0x44CD1F493DB2A0A6", "_SET_VEHICLE_WEAPON_CAPACITY"]
---
## SET_VEHICLE_WEAPON_RESTRICTED_AMMO

```c
// 0x44CD1F493DB2A0A6
void SET_VEHICLE_WEAPON_RESTRICTED_AMMO(Vehicle vehicle, int weaponIndex, int ammoCount);
```
Sets a limited number of ammo for a particular vehicle weapon index on a vehicle.
Information about weapon indexes can be found in `handling.meta`.
In the example given below, `uWeaponHash` defines weapon hashes for the vehicle. Each `<Item>` corresponds to an index starting from `0`.
```
<uWeaponHash>
<Item>VEHICLE_WEAPON_PLAYER_BUZZARD</Item> <!-- Index: 0 -->
<Item>VEHICLE_WEAPON_SPACE_ROCKET</Item> <!-- Index: 1 -->
<Item>VEHICLE_WEAPON_SEARCHLIGHT</Item> <!-- Index: 2 -->
</uWeaponHash>
```
## Parameters
* **vehicle**: The vehicle handle
* **weaponIndex**: The weapon index we're setting ammo for (between `0` and `3`), see description for more.
* **ammoCount**: When set positive, will count down with every fire and prevent firing at `0`. Set `-1` to disable restricted ammo.

0 comments on commit bd5e91f

Please sign in to comment.