Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- elseif action == 'impound' then
- -- is the script busy?
- if currentTask.busy then
- return
- end
- ESX.ShowHelpNotification(_U('impound_prompt'))
- TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true)
- currentTask.busy = true
- currentTask.task = ESX.SetTimeout(10000, function()
- ClearPedTasks(playerPed)
- ImpoundVehicle(vehicle)
- Citizen.Wait(100) -- sleep the entire script to let stuff sink back to reality
- end)
- -- keep track of that vehicle!
- Citizen.CreateThread(function()
- while currentTask.busy do
- Citizen.Wait(1000)
- vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71)
- if not DoesEntityExist(vehicle) and currentTask.busy then
- ESX.ShowNotification(_U('impound_canceled_moved'))
- ESX.ClearTimeout(currentTask.task)
- ClearPedTasks(playerPed)
- currentTask.busy = false
- break
- end
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement