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(es_extended/client/modules/death): add gameEventTriggered for pl… #1606

Closed
wants to merge 1 commit into from

Conversation

foltone
Copy link

@foltone foltone commented Jan 25, 2025

feat(es_extended/client/modules/death): add gameEventTriggered for player death handling


Description

This merge request implements the gameEventTriggered event to handle player deaths. The logic distinguishes between deaths caused by another player (Death:ByPlayer) and natural causes (Death:Natural), ensuring code robustness and optimization.


Key Changes

  • Implemented gameEventTriggered to manage CEventNetworkEntityDamage for player death detection.
  • Added the following functions:
    • Death:ByPlayer: Handles deaths caused by other players.
    • Death:Natural: Handles deaths from natural causes.
    • Death:ResetValues: Resets death-related data after processing.
  • Improved client-server event communication with esx:onPlayerDeath.

Checklist

  • My PR title and commit messages follow the Conventional Commits standard.
  • My changes have been tested locally and work as expected.
  • My PR does not introduce breaking changes.
  • I have provided a clear explanation and context for the changes.

Rationale

  • Fixes gaps in the player death handling system.
  • Improves robustness and entity validation checks.
  • Ensures better communication for client and server death events.

Thank you for reviewing this PR and helping improve death handling in ESX! 🎉

@Kenshiin13
Copy link
Contributor

This was the previous method we used for the death module and has been replaced by a simple thread. CEventNetworkEntityDamage is very much overkill as it can be triggered hundereds of times per second when driving a vehicle into an object for example. There is no plan for us to switch back, the current thread works just fine.

@Kenshiin13 Kenshiin13 closed this Jan 25, 2025
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