samp-weapon-config
samp-weapon-config copied to clipboard
Double damage
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.
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.
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.