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

fix(es_extended/client/main): fix throwables and parachutes #1521

Merged
merged 9 commits into from
Dec 1, 2024

Conversation

Kenshiin13
Copy link
Contributor

@Kenshiin13 Kenshiin13 commented Dec 1, 2024

Description

This PR fixes the handling of throwables and parachutes in the ESX loadout.


Key Changes:

  1. Throwable Ammo Handling:

    • Throwables were not being tracked properly in ESX. While ESX would set their ammo count to 0, the weapons themselves were not being removed from the loadout, even though the game itself does. This discrepancy caused issues where throwables couldn't be re-added to the loadout by ESX.
    • To fix this, a throwable config entry has been added for all throwable weapons in the es_extended/shared/config/weapons.lua file. Now, when the ammo count of a throwable reaches 0, the weapon is completely removed from the loadout, allowing ESX to handle them correctly.
  2. Parachute Ammo Handling:

    • A thread has been introduced to detect when a parachute is used. Once deployed, the parachute’s ammo count is set to 0, and the item is removed from the loadout, similar to throwable weapons.
    • Parachutes are now classified as throwables and will be handled accordingly in the loadout when their ammo count reaches 0.

Affected Weapons:

The following weapons are now properly handled in ESX:

  • WEAPON_GRENADE (Grenade)
  • WEAPON_BZGAS (BZ Gas)
  • WEAPON_MOLOTOV (Molotov Cocktail)
  • WEAPON_STICKYBOMB (Sticky Bomb)
  • WEAPON_PROXMINE (Proximity Mines)
  • WEAPON_SNOWBALL (Snowballs)
  • WEAPON_PIPEBOMB (Pipe Bombs)
  • WEAPON_BALL (Baseball)
  • WEAPON_SMOKEGRENADE (Smoke Grenade)
  • WEAPON_FLARE (Flare)
  • WEAPON_ACIDPACKAGE (Acid Package)
  • GADGET_PARACHUTE (Parachute)
  • WEAPON_PETROLCAN (Jerrycan)
  • WEAPON_HAZARDCAN (Hazardous Jerrycan)

@Kenshiin13 Kenshiin13 self-assigned this Dec 1, 2024
[core]/es_extended/client/main.lua Outdated Show resolved Hide resolved
[core]/es_extended/client/main.lua Outdated Show resolved Hide resolved
@esx-framework esx-framework deleted a comment from mcNuggets1 Dec 1, 2024
@Kenshiin13 Kenshiin13 merged commit 369a015 into esx-framework:dev Dec 1, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Published
Development

Successfully merging this pull request may close these issues.

3 participants