Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. Possible FIX du /dv donc de la fourrière aussi peut etre
  2.  
  3.  
  4.  
  5.  
  6. RegisterNetEvent('esx:deleteVehicle')
  7. AddEventHandler('esx:deleteVehicle', function()
  8. local playerPed = PlayerPedId()
  9. local vehicle = ESX.Game.GetVehicleInDirection()
  10. local entity = vehicle
  11. carModel = GetEntityModel(entity)
  12. carName = GetDisplayNameFromVehicleModel(carModel)
  13. NetworkRequestControlOfEntity(entity)
  14.  
  15. local timeout = 2000
  16. while timeout > 0 and not NetworkHasControlOfEntity(entity) do
  17. Wait(100)
  18. timeout = timeout - 100
  19. end
  20.  
  21. SetEntityAsMissionEntity(entity, true, true)
  22.  
  23. local timeout = 2000
  24. while timeout > 0 and not IsEntityAMissionEntity(entity) do
  25. Wait(100)
  26. timeout = timeout - 100
  27. end
  28.  
  29. Citizen.InvokeNative( 0xEA386986E786A54F, Citizen.PointerValueIntInitialized( entity ) )
  30.  
  31. if (DoesEntityExist(entity)) then
  32. DeleteEntity(entity)
  33. end
  34. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement