Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. elseif action == 'impound' then
  2. -- is the script busy?
  3. if currentTask.busy then
  4. return
  5. end
  6.  
  7. ESX.ShowHelpNotification(_U('impound_prompt'))
  8. TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true)
  9.  
  10. currentTask.busy = true
  11. currentTask.task = ESX.SetTimeout(10000, function()
  12. ClearPedTasks(playerPed)
  13. ImpoundVehicle(vehicle)
  14. Citizen.Wait(100) -- sleep the entire script to let stuff sink back to reality
  15. end)
  16.  
  17. -- keep track of that vehicle!
  18. Citizen.CreateThread(function()
  19. while currentTask.busy do
  20. Citizen.Wait(1000)
  21.  
  22. vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 3.0, 0, 71)
  23. if not DoesEntityExist(vehicle) and currentTask.busy then
  24. ESX.ShowNotification(_U('impound_canceled_moved'))
  25. ESX.ClearTimeout(currentTask.task)
  26. ClearPedTasks(playerPed)
  27. currentTask.busy = false
  28. break
  29. end
  30. end
  31. end)
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement