samp-weapon-config icon indicating copy to clipboard operation
samp-weapon-config copied to clipboard

Double damage

Open CeloTL opened this issue 3 years ago • 2 comments

The script has been evolving and correcting many errors, but there is an issue in effect which is double damage, where the offender can multiply the weapon's damage by 2x (with one hit). I tried to block it with GetWeaponDamage, comparing it to the damage done, but without success.

CeloTL avatar Dec 10 '21 17:12 CeloTL

Could you give us more information then this? I need a reproducible gamemode or code that can be used to verify this. I haven't seen this show up in my testing so far.

ADRFranklin avatar Dec 10 '21 17:12 ADRFranklin

Cheaters can send a couple of OnPlayerGiveDamage per one shot, but if you try to limit it to "1 shot = 1 damage packet and no more" here, then most of the damage will stop passing between players on your server, because weapons with high rate of fire and some network delays often generate event order like this:

OnPlayerWeaponShot //Shot 1 fired
OnPlayerWeaponShot //Shot 2 fired
OnPlayerGiveDamage //Shot 1 did damage
OnPlayerGiveDamage //Shot 2 did damage

(not like that):

OnPlayerWeaponShot //Shot 1 fired
OnPlayerGiveDamage //Shot 1 did damage
OnPlayerWeaponShot //Shot 2 fired
OnPlayerGiveDamage //Shot 2 did damage

So, the current restrictions seem to be the most appropriate thing that could be done.

NexiusTailer avatar Feb 28 '22 06:02 NexiusTailer