oscar-broman / samp-weapon-config

A more consistent and responsive damage system with many new features
Apache License 2.0
91 stars 84 forks source link

Double damage #232

Open CeloTL opened 2 years ago

CeloTL commented 2 years ago

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.

ADRFranklin commented 2 years ago

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.

NexiusTailer commented 2 years ago

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.