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

refactor: replace client-side event with server-side RemoveWeaponComponentFromPed native #1596

Closed
wants to merge 2 commits into from

Conversation

btwlouis
Copy link
Contributor

Description

This pull request refactors the weapon component removal functionality by replacing the previous client-side event with a server-side implementation. The main goal is to enhance security and maintain better control over weapon components by utilizing the RemoveWeaponComponentFromPed native directly from the server.


Motivation

The current implementation relied on a client-side event (esx:removeWeaponComponent) for removing weapon components. By shifting this logic to the server-side, we ensure better security and centralized control over the weapon component removal process.


Implementation Details

  • In the server-side class, the removeWeaponComponent function now handles the logic of removing the weapon component from the player's ped using the RemoveWeaponComponentFromPed native.

PR Checklist

  • My commit messages and PR title follow the Conventional Commits standard.
  • My changes have been tested locally and function as expected.
  • My PR does not introduce any breaking changes.
  • I have provided a clear explanation of what my PR does, including the reasoning behind the changes and any relevant context.

@Mycroft-Studios
Copy link
Member

RemoveWeaponComponentFromPed is RPC, therefore this is still the exact same as before, with the event just being internal instead

@btwlouis
Copy link
Contributor Author

GiveWeaponToPed is also RPC and used for xPlayer.addWeapon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Recycle Bin
Development

Successfully merging this pull request may close these issues.

2 participants