[Include] Damage Mod Detection
#1

This include detects damage mods. Damage mods are basically a cheat that allows you to take a lower damage than the weapon actually gives, thus keeping you alive longer.

The way this script detects players damage modding is pretty interesting. It checks the shooter for the amount of damage they would want to take from another player. Meaning if I had damage mods and I shot another player, it would call the callback because I'm damage modding.

OnPlayerGiveDamage returns the following in the callback:
  • playerid - The player that issued the damage.
  • damagedid - The player that is supposed to take the damage.
  • amount - The amount of damage your character wants to take.
  • weaponid - The weapon that is giving the damage.
  • bodypart - The bodypart the damage is being given to.
Basically, it works without the player having damage mods being shot. All the player has to do is shoot someone while having them and they'll be detected.

UPDATE: May 29th, 2018:
If you wish to use OnPlayerTakeDamage for players that aren't shooting, but you want them detected. Do:
PHP код:
#define DM_USE_OPTD 
before including this script.

The callback below has been updated to include the person that was involved with the detection as well.

Add this to your script and from there decide what to do with the damage modder:
PHP код:
public OnPlayerDamageModding(suspectidinvolvedidweaponidFloat:damageamt)
{
    return 
1// This callback doesn't handle returns

Pastebin Link
Reply
#2

Not sure if this is going to return false positives on several cases depending on range/lag and whatnot but overall, shouldn't this:
Код:
OnPlayerDamageModding(playerid, weaponid, amount);
Have damagedid instead? since you said an i quote:
Quote:

a cheat that allows you to take a lower damage than the weapon actually gives

So the cheater is the one taking damage not giving damage, no?
Reply
#3

Cool cool, weapon-config kinda does this.

Doesn't seem like you considered different weapon skills tho s:
Reply
#4

Good job
Reply
#5

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
Not sure if this is going to return false positives on several cases depending on range/lag and whatnot but overall, shouldn't this:
Код:
OnPlayerDamageModding(playerid, weaponid, amount);
Have damagedid instead? since you said an i quote:

So the cheater is the one taking damage not giving damage, no?
The cheater is the one giving the damage. OPGD's amount returns the damage the shooter would've taken with the same shot .

As far as range, lag, and what not are concerned, weapons in GTA don't differ damages by distance and stuff. A body hit with a deagle will always give 46.2___ so on and forth.

Quote:
Originally Posted by Kar
Cool cool, weapon-config kinda does this.

Doesn't seem like you considered different weapon skills tho s:
It's something I made a while back that I never considered releasing. If I get the time, I'll mess around with the skill levels and such and see what I can come of it.
Reply
#6

@Kar
After some research into the different skill levels, there doesn't seem to be an issue with the skill levels and this. Weapons still give the same amount of damage when single or duel wielded. Duel wielding just allows faster shooting.
Reply
#7

Quote:
Originally Posted by Banana_Ghost
Посмотреть сообщение
The cheater is the one giving the damage. OPGD's amount returns the damage the shooter would've taken with the same shot .

As far as range, lag, and whatnot are concerned, weapons in GTA don't differ damages by distance and stuff. A body hit with a Deagle will always give 46.2___ so on and forth.
If so then why not call the callback on both the player taking damage at OnPlayerTakeDamage and giving damage at OnPlayerGiveDamage to get the accurate result? what if the cheater doesn't hit others and just takes damage?

What if he decreases the damage of all weapons to 0 except the M4 and keeps killing others with M4?
Reply
#8

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
If so then why not call the callback on both the player taking damage at OnPlayerTakeDamage and giving damage at OnPlayerGiveDamage to get the accurate result? what if the cheater doesn't hit others and just takes damage?

What if he decreases the damage of all weapons to 0 except the M4 and keeps killing others with M4?
The code was originally wrote to work with OnPlayerTakeDamage, check the topic for a modified version where you can enable OnPlayerTakeDamage if you wish to.

If he keeps using the M4 to shoot and the damage he would take isn't modified, then he technically isn't cheating for the moment, but if he changes weapons to one that is modified, then of course the script will take care of it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)