Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local radares = {
- {x = 379.68807983398, y = -1048.3527832031, z = 29.250692367554},
- {x = -253.10794067383, y = -630.20385742188, z = 33.002685546875},
- }
- Citizen.CreateThread(function()
- while true do
- Wait(0)
- for k,v in pairs(radares)
- local player = GetPlayerPed(-1)
- local coords = GetEntityCoords(player, true)
- if Vdist2(radares[k].x, radares[k].y, radares[k].z, coords["x"], coords["y"], coords["z"]) < 50 then
- Citizen.Trace("estas a passar um radar")
- checkSpeed()
- end
- end
- end
- end)
- function checkSpeed()
- local pP = GetPlayerPed(-1)
- local speed = GetEntitySpeed(pP)
- local vehicle = GetVehiclePedIsIn(pP, false)
- local driver = GetPedInVehicleSeat(vehicle, -1)
- local maxspeed = 80
- local kmhspeed = math.ceil(speed*3.6)
- if kmhspeed > maxspeed and driver == pP then
- Citizen.Wait(250)
- TriggerServerEvent('cobrarMulta')
- exports.pNotify:SetQueueMax("left", 1)
- exports.pNotify:SendNotification({
- text = "Voce foi multado por excesso de velocidade",
- type = "error",
- timeout = 5000,
- layout = "centerLeft",
- queue = "left"
- })
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement