SHARE
TWEET

Untitled

a guest Aug 22nd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local radares = {
  2. {x = 379.68807983398, y = -1048.3527832031, z = 29.250692367554},
  3. {x = -253.10794067383, y = -630.20385742188, z = 33.002685546875},
  4. }
  5.  
  6. Citizen.CreateThread(function()
  7.   while true do
  8.     Wait(0)
  9.     for k,v in pairs(radares)
  10.     local player = GetPlayerPed(-1)
  11.     local coords = GetEntityCoords(player, true)
  12.     if Vdist2(radares[k].x, radares[k].y, radares[k].z, coords["x"], coords["y"], coords["z"]) < 50 then
  13.     Citizen.Trace("estas a passar um  radar")
  14.         checkSpeed()
  15.     end
  16.   end
  17.  end
  18. end)
  19.  
  20.   function checkSpeed()
  21.   local pP = GetPlayerPed(-1)
  22.   local speed = GetEntitySpeed(pP)
  23.   local vehicle = GetVehiclePedIsIn(pP, false)
  24.   local driver = GetPedInVehicleSeat(vehicle, -1)
  25.   local maxspeed = 80
  26.     local kmhspeed = math.ceil(speed*3.6)
  27.         if kmhspeed > maxspeed and driver == pP then
  28.             Citizen.Wait(250)
  29.             TriggerServerEvent('cobrarMulta')
  30.             exports.pNotify:SetQueueMax("left", 1)
  31.             exports.pNotify:SendNotification({
  32.             text = "Voce foi multado por excesso de velocidade",
  33.             type = "error",
  34.             timeout = 5000,
  35.             layout = "centerLeft",
  36.             queue = "left"
  37.           })
  38.     end
  39. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top