Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Citizen.CreateThread(function()
- while true do
- Wait(1)
- playerPed = GetPlayerPed(-1)
- if playerPed then
- checkCar(GetVehiclePedIsIn(playerPed, false))
- x, y, z = table.unpack(GetEntityCoords(playerPed, true))
- for _, blacklistedCar in pairs(carblacklist) do
- checkCar(GetClosestVehicle(x, y, z, 100.0, GetHashKey(blacklistedCar), 70))
- end
- end
- end
- end)
- function checkCar(car)
- if car then
- carModel = GetEntityModel(car)
- carName = GetDisplayNameFromVehicleModel(carModel)
- if isCarBlacklisted(carModel) then
- SetEntityAsMissionEntity(car, true, true)
- DeleteVehicle(car)
- sendForbiddenMessage("This vehicle is blacklisted!")
- end
- end
- end
- function isCarBlacklisted(model)
- for _, blacklistedCar in pairs(carblacklist) do
- if model == GetHashKey(blacklistedCar) then
- return true
- end
- end
- return false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement