Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

Commit

Permalink
Melee check now checks for damaging a ped
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat authored Jan 29, 2021
1 parent 241549d commit 5a2ce5a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 5a2ce5a

Please sign in to comment.