Skip to content

Commit

Permalink
Merge pull request Project-Sloth#9 from z0nzjn123/patch-1
Browse files Browse the repository at this point in the history
Fix impound and clean
  • Loading branch information
MonkeyWhisper authored Apr 9, 2022
2 parents b16d3a8 + 043d057 commit b1f3377
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ RegisterNUICallback("saveVehicleInfo", function(data, cb)
local impound = data.impound
local JobType = GetJobType(PlayerData.job.name)
if JobType == 'police' and impound.impoundChanged == true then
if impound.inpoundActive then
if impound.impoundActive then
local found = 0
local plate = string.upper(string.gsub(data['plate'], "^%s*(.-)%s*$", "%1"))
local vehicles = GetGamePool('CVehicle')
Expand All @@ -543,8 +543,10 @@ RegisterNUICallback("saveVehicleInfo", function(data, cb)
if plt == plate then
local dist = #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(v))
if dist < 5.0 then
print(true)
found = VehToNet(v)
SendNUIMessage({ type = "greenImpound" })
TriggerServerEvent('mdt:server:saveVehicleInfo', dbid, plate, imageurl, notes, stolen, code5, impound)
end
break
end
Expand All @@ -554,22 +556,21 @@ RegisterNUICallback("saveVehicleInfo", function(data, cb)
QBCore.Functions.Notify('Vehicle not found!', 'error')
SendNUIMessage({ type = "redImpound" })
end
--TriggerServerEvent('mdt:server:impoundVehicle', data, found)
--cb('ok')
else
local ped = PlayerPedId()
local playerPos = GetEntityCoords(ped)
for k, v in pairs(Config.ImpoundLocations) do
if (#(playerPos - vector3(v.x, v.y, v.z)) < 20.0) then
--TriggerServerEvent('mdt:server:removeImpound', data['plate'], k)
impound.CurrentSelection = k
TriggerServerEvent('mdt:server:saveVehicleInfo', dbid, plate, imageurl, notes, stolen, code5, impound)
break
end
end
end
else
TriggerServerEvent('mdt:server:saveVehicleInfo', dbid, plate, imageurl, notes, stolen, code5, impound)
end
print(impound.CurrentSelection)
TriggerServerEvent('mdt:server:saveVehicleInfo', dbid, plate, imageurl, notes, stolen, code5, impound)
cb(true)
end)

Expand Down Expand Up @@ -850,4 +851,4 @@ end)

RegisterNetEvent('mdt:client:statusImpound', function(data, plate)
SendNUIMessage({ type = "statusImpound", data = data, plate = plate })
end)
end)

0 comments on commit b1f3377

Please sign in to comment.