Hey I was wondering how to disable Pistol Whiping. So when I stand near a player and Shoot or Reload I don’t knock him over. Please help.
Place these lines of code in a loop:
Pulled from one of my resources because I’m on mobile.
What you mean In a loop? Do I just coppy the whole thing and make a script?
Don’t copy the entire thing unless you want to use that resource; it does more than just disable pistol whip.
Place this code in a script:
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
-- Disable Pistol whip
DisableControlAction(0, 140, true)
DisableControlAction(0, 141, true)
DisableControlAction(0, 142, true)
DisableControlAction(0, 263, true)
DisableControlAction(0, 264, true)
end
end)
Thank you.
Or instead of running useless stuff on clients & disabling controls, edit the meta files and remove AllowCloseQuarterKills from weapon flags
Interesting alternative, are you achieving this through streaming custom metas for every single weapon?
Believe to do it entirely correctly you have to edit the general weapons.meta & any other more specific files (IE: weaponrevolver.meta) but I’ve made the change in just weapons.meta and it’s working. Also possible to do things like change tazer length, make the tazer actually not kill people, or remove damage from punching/melee weapons.
When I do that I cant even Punch Stab or do damage in front of players.
Where are those Meta Files?
Not a bad idea to be honest, +1.
If you’re sticking with doing it in code and not metas, you’ll need to add a check to see if the ped is armed.
Someone know where those weapon.meta files are? Searching whole day for it.
Use OpenIV to get the latest, then just add it to any resource and add:
files {
'weapons.meta',
}
data_file 'WEAPONINFO_FILE_PATCH' 'weapons.meta'
To your manifest file
I’ll link this for additional reading, for anyone reading in the future wanting to take it further.
Yeah but I cant the weapons.meta in OpenIV. I need to know exactly where.
\update\update.rpf\common\data\ai
I removed now every 45 AllowCloseQuarterKills from weapons.meta what do I do now?
What is a manifest file again? Sry im lost. Didn’t do this long time.
__resource.lua (or fxmanifest)