Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- autor: EZ3N (for: ventos-rpg.pl)
- wszelkie prawwa zastrzezone!
- ]]
- local sw,sh = guiGetScreenSize()
- local baseX = 1920
- local zoom = 1
- zoom=1920/sw
- function wczytajFont()
- roboto = dxCreateFont("/misc/roboto.ttf",12/zoom)
- end
- function usunFont()
- if roboto then
- destroyElement(roboto)
- roboto = nil
- end
- end
- local miejsca = {
- --{x,y,z,dystans,limit}
- {1569.40234375, -2471.0029296875, 13.5546875, 5, 80},
- {1536.0908203125, -2466.4052734375, 13.28168296814,4,60},
- }
- function pokazMandat()
- if ss then
- dxDrawImage(61/zoom, 419/zoom, 432/zoom, 243/zoom, ss, 350, 0, 0, tocolor(255,255,255), false)
- dxDrawText(getVehiclePlateText(getPedOccupiedVehicle(localPlayer)), 715/zoom, 780/zoom, 1205/zoom, 1070/zoom, tocolor(100,255,100, 255), 1, roboto, "center", "center", false)
- dxDrawText("KM/h: "..string.format("%.00f",kmh), 715/zoom, 830/zoom, 1205/zoom, 1070/zoom, tocolor(255, 255, 255, 255), 1, roboto, "center", "center", false)
- dxDrawText("PKT.KARNE: "..getElementData(localPlayer,"punkty:karne").."/20", 715/zoom, 880/zoom, 1205/zoom, 1070/zoom, tocolor(255, 255, 255, 255), 1, roboto, "center", "center", false)
- dxDrawText("POZIOM POSZUKIWAŃ: 2", 715/zoom, 930/zoom, 1205/zoom, 1070/zoom, tocolor(255, 255, 255, 255), 1, roboto, "center", "center", false)
- end
- end
- function wlaczFotoradar()
- for k,v in pairs(miejsca) do
- if (source == miejsca[k].cs) then
- if isPedInVehicle(localPlayer) then
- pojazd = getPedOccupiedVehicle(localPlayer)
- if getVehicleSirensOn(pojazd) or getVehicleType(pojazd) == "Plane" or getVehicleType(pojazd) == "Helicopter" or getVehicleType(pojazd) == "Boat" or getVehicleType(pojazd) == "BMX" or getElementDimension(localPlayer) ~= 0 or getElementInterior(localPlayer) ~= 0 or getVehicleController(pojazd) ~= localPlayer then return end
- speedx,speedy,speedz = getElementVelocity(pojazd)
- actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5)
- kmh = actualspeed * 180
- przekroczenie = kmh - miejsca[k][5]
- limit = miejsca[k][5]
- liczbapkt = przekroczenie > 100 and 0.5 or przekroczenie > 75 and 0.4 or przekroczenie > 50 and 0.3 or przekroczenie > 25 and 0.2 or przekroczenie < 10 and 0.1
- if (kmh-10>miejsca[k][5]) then
- if isEventHandlerAdded("onClientRender",root,pokazMandat) then return end
- fadeCamera(false,0.1,255,255,255)
- ss = dxCreateScreenSource(500,500)
- dxUpdateScreenSource(ss)
- addEventHandler("onClientRender",root,pokazMandat)
- wczytajFont()
- setTimer(fadeCamera,60,1,true,1.5)
- setElementData(localPlayer,"punkty:karne",getElementData(localPlayer,"punkty:karne")+liczbapkt)
- setTimer(function()
- removeEventHandler("onClientRender",root,pokazMandat)
- usunFont()
- end, 5000,1)
- end
- end
- end
- end
- end
- for k,v in pairs(miejsca) do
- miejsca[k].cs = createColSphere(miejsca[k][1],miejsca[k][2],miejsca[k][3],miejsca[k][4])
- end
- addEventHandler("onClientColShapeHit",resourceRoot,wlaczFotoradar)
- function isEventHandlerAdded( sEventName, pElementAttachedTo, func )
- if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then
- local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo )
- if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
- for i, v in ipairs( aAttachedFunctions ) do
- if v == func then
- return true
- end
- end
- end
- end
- return false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement