fivem icon indicating copy to clipboard operation
fivem copied to clipboard

Allow cancelling CEventNetworkEntityDamage to prevent damage

Open mcNuggets1 opened this issue 1 year ago • 8 comments

What happened?

I would propose a way to disable taking damage for players, while not using SetEntityInvincible or similiar natives, as I'm trying to implement my own death state, that isn't as buggy as GTA's (with stopped networking etc).

Expected result

To stop a event

Reproduction steps

There are none, this is a suggestion, I hope, I can do these here.

Importancy

Unknown

Area(s)

FiveM, FXServer, OneSync, Natives

Specific version(s)

FiveM

Additional information

No response

mcNuggets1 avatar Jan 16 '24 13:01 mcNuggets1

Some implementation note: a server-side event handler would need a bit more advanced logic than just suppressing the event, as it'd also need a fake reply sent to the originating client.

Similarly, a damage callback for local damage could be curious, too, and seems to be what this person is requesting.

blattersturm avatar Jan 16 '24 14:01 blattersturm

I'm talking pure clientside.

What I'm requesting is a better way or any way to prevent the player from dying INSIDE the NetworkEntityDamage event or OTHER events or functions.

Players should not die in code on my server, I wanna do my own death system and have it network the ragdoll further (which stops when the player dies in many cases)

mcNuggets1 avatar Jan 20 '24 13:01 mcNuggets1

I'd vote for the server-side event handler. Giving the client less control over stuff is a great idea considering the amount of cheaters etc.

Overall this is a good idea anyways.

Gittified avatar Jan 23 '24 21:01 Gittified

I'd vote for the server-side event handler. Giving the client less control over stuff is a great idea considering the amount of cheaters etc.

Overall this is a good idea anyways.

Why not both? Would be handy for networking stuff. I don't want huge delays in gameplay.

mcNuggets1 avatar Jan 24 '24 15:01 mcNuggets1

Dont know if this has still been looked at but this would be AMAZING to stop cheaters from creating unwanted damaged events to players!

If the logic server sided is tricky and if not weird then let it be it! As long as we can get something to play with things like that. It can open doors in regards to scripts that handle damage given to the player and anti-cheat scripts. But, I will say, it can not be done client side, if there is any such thing made that can cancel out damage client sided it will be ABUSED by cheaters, I wouldn't recommend such event existing for the client, solely just server sided.

Mane48 avatar Feb 28 '24 07:02 Mane48

Dont know if this has still been looked at but this would be AMAZING to stop cheaters from creating unwanted damaged events to players!

If the logic server sided is tricky and if not weird then let it be it! As long as we can get something to play with things like that. It can open doors in regards to scripts that handle damage given to the player and anti-cheat scripts. But, I will say, it can not be done client side, if there is any such thing made that can cancel out damage client sided it will be ABUSED by cheaters, I wouldn't recommend such event existing for the client, solely just server sided.

Same opinion. It's a shame we cannot combat cheaters efficiently in this manner.

mcNuggets1 avatar Apr 21 '24 13:04 mcNuggets1