From 5a2ce5ac7709495d5c95afbbf4cdf51a96f70969 Mon Sep 17 00:00:00 2001 From: thelindat <65407488+thelindat@users.noreply.github.com> Date: Sat, 30 Jan 2021 06:22:29 +1100 Subject: [PATCH] Melee check now checks for damaging a ped --- client.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client.lua b/client.lua index 3873712..8e3cd82 100644 --- a/client.lua +++ b/client.lua @@ -250,6 +250,7 @@ Citizen.CreateThread(function() for k, v in pairs(Config.Timer) do if v > 0 then Config.Timer[k] = v - 1 end end + if GetVehiclePedIsUsing(playerPed) ~= 0 then local vehicle = GetVehiclePedIsUsing(playerPed, true) if vehicleWhitelist[GetVehicleClass(vehicle)] then @@ -307,7 +308,7 @@ Citizen.CreateThread(function() else Config.Timer['Shooting'] = Config.Shooting.Fail end - elseif Config.Timer['Melee'] == 0 and IsPedInMeleeCombat(playerPed) then -- TODO: detect when punching a ped, currently just detects player in combat stance + elseif Config.Timer['Melee'] == 0 and IsPedInMeleeCombat(playerPed) and HasPedBeenDamagedByWeapon(GetMeleeTargetForPed(playerPed), 0, 1) then sleep = 10 if zoneChance('Melee', currentStreetName) then data = {dispatchCode = 'melee', caller = _U('caller_local'), street = playerStreetsLocation, coords = playerCoords, netId = NetworkGetNetworkIdFromEntity(playerPed), length = 4000}