-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
Add the possibility to cancel onPedDamage
event - QOL feature
#3387
Comments
Damage Handler is located on the client side and this is where the onClientPedDamage event is sent and, depending on its status, the handler returns the result. The server-side event works based on the synchronization packet, where the amount of HP is compared between packets. I think a reasonable solution would be to set the HP amount to something like "current HP + loss" if the event was canceled. However, I don't know what happens when the ped/player dies? Then, despite the event being canceled, onPedWasted will be sent + the invicible bug will probably appear (#414 ) |
if the server sends packets to the client about ped damage then
Yeah we would need to check if loss >= currentHP and not run onPedWasted if the event was cancelled and ped died I tried to implement it but its a lot of complicated work |
We can't stop sending the sync packet and ignore everything. These packets concern general data synchronization between clients and the server, not just health. Canceling the sending of synchronization packets after canceling the event will cause desynchronization bugs |
If its about health only then how would that cause desync with other players? For other ped related packets, sure. However if we are cancelling the damage event then only the packets responsible for ped's health should be ignored |
The sync packet covers a lot of information, not just health, so you can't just cancel it mtasa-blue/Server/mods/deathmatch/logic/CPedSync.cpp Lines 245 to 264 in 1f2c6e7
|
Is your feature request related to a problem? Please describe.
Right now to cancel ped's damage you have to use
onClientPedDamage
or do an extensive check withonPedWasted
+setElementHealth
.Cancelling the event will be a very good QOL feature.
Describe the solution you'd like
Be able to cancel
onPedDamage
eventDescribe alternatives you've considered
No response
Additional context
No response
Security Policy
The text was updated successfully, but these errors were encountered: