How to modify Melee Damage

This did not fix it :confused: should this be server or client file?

figured it out, had to change

GetCurrentPedWeapon()

to

GetSelectedPedWeapon()

BUT i’m still having the same problem. I want to reduce the damage of being pistol whipped, or melee by firearm

EDIT:

after further testing, this did not fix the issue, people are still dying from getting hit with a weapon in one hit…

1 Like

Looked into this a bit and doesn’t look like you can reduce the damage. Pistol whip is handled by the CActionDefinitions(see: data/action/definitions.meta) and I don’t think you can stream that file. The damage itself is DAR_kill_self_head from data/action/damages.meta which has the DRA_IGNORE_ARMOR DRA_IGNORE_STAT_MODIFIERS attributes meaning the damage isn’t affected by the weapon or melee multipliers.

If you want to you could disable pistol whipping. I haven’t tested but removing the AllowCloseQuarterKills weapon flag from each weapon in weapons.meta should disable pistol whipping.

EDIT:

Looks like the ACTION_TABLE_DEFINITIONS data mounter is likely for data/action/definitions.meta.

I will definitely update the pistol whip thing, but the code above still doesn’t seem to work for me even for melee weapon, like I still get one shot from a bat

Melee weapons also have a close quarter kill melee action and on top of that they can critical hit when you hit someone in the head. So you will want to remove the AllowCloseQuarterKills flag and adjust the headshot damage multiplier for melee weapons in weapons.meta.

I explained the critical hit damage in another thread.

1 Like

Here you go guys, much simpler!

Citizen.CreateThread(function()
    while true do
	N_0x4757f00bc6323cfe(GetHashKey("WEAPON_UNARMED"), 0.5) 
	Wait(0)
    end
end)

(0.5 is the damage modifier 0.00 - 1.00)

10 Likes

Can i ask what does this code suggest to?

Its an undocumented native for weapon damage modifier

so i can use it with any meelee wapon right?

yes yes

to see the effect or result of the damage you have to reset the server or only with reset script

Hey thanks a lot for this, i have a little question about it.
If i want to modify severals weapons should i go like this :

Citizen.CreateThread(function()
    while true do
	N_0x4757f00bc6323cfe(GetHashKey("WEAPON_UNARMED"), 0.5)
	N_0x4757f00bc6323cfe(GetHashKey("WEAPON_PISTOL50"), 0.2) 
	N_0x4757f00bc6323cfe(GetHashKey("WEAPON_MICROSMG"), 0.2) 
	Wait(0)
    end
end)

Will it work like this ?

Thanks :slight_smile:

1 Like

yep that’ll work

2 Likes

But that only reduce damage weapons not melee damage, is their something i didn’t get ?

It will work just fine, but for reading reasons, create a dictionary with the name of the weapons and the damage after, or just create a function and keep calling her every time you need it.

Thanks for your reply but i miss some skills to write this !
I going to try to compile some code from @BabbaTundaee with this

Sure, i have created i script that does exactly this, if you want, feel free to use it. It’s in my profile.

1 Like

You’re then men! Thank you ! :clap: I’ll try it today with my weapon list and add it to your post !

1 Like

I can use with all melee weapon except knife
can anyone help me?

N_0x4757f00bc6323cfe(GetHashKey(“WEAPON_KNIFE”), 0.2)
Wait(0)

is that right?
its still just one shot can kill.

Thank you for sharing. Is there anyway to modify headshot damage for weapons? or modify headshot damage for all weapons combined?