Advertisement
Guest User

Untitled

a guest
Aug 15th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. Citizen.CreateThread(function()
  2. while true do
  3. Wait(1)
  4.  
  5. playerPed = GetPlayerPed(-1)
  6. if playerPed then
  7. checkCar(GetVehiclePedIsIn(playerPed, false))
  8.  
  9. x, y, z = table.unpack(GetEntityCoords(playerPed, true))
  10. for _, blacklistedCar in pairs(carblacklist) do
  11. checkCar(GetClosestVehicle(x, y, z, 100.0, GetHashKey(blacklistedCar), 70))
  12. end
  13. end
  14. end
  15. end)
  16.  
  17. function checkCar(car)
  18. if car then
  19. carModel = GetEntityModel(car)
  20. carName = GetDisplayNameFromVehicleModel(carModel)
  21.  
  22. if isCarBlacklisted(carModel) then
  23. SetEntityAsMissionEntity(car, true, true)
  24. DeleteVehicle(car)
  25. sendForbiddenMessage("This vehicle is blacklisted!")
  26. end
  27. end
  28. end
  29.  
  30. function isCarBlacklisted(model)
  31. for _, blacklistedCar in pairs(carblacklist) do
  32. if model == GetHashKey(blacklistedCar) then
  33. return true
  34. end
  35. end
  36.  
  37. return false
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement