local screenW, screenH = guiGetScreenSize()
function pokazgui()
exports["buttons"]:createCustomWindow("Wirtualny Parking", screenW * 0.2016, screenH * 0.2286, screenW * 0.6092, screenH * 0.5805, tocolor(255, 255, 255, 255), false)
exports["buttons"]:createCustomButton("Akademia", screenW * 0.2192, screenH * 0.3019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Radiow?z", screenW * 0.3692, screenH * 0.3019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Radiow?z2", screenW * 0.5292, screenH * 0.3019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Merit", screenW * 0.6792, screenH * 0.3019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Enforcer", screenW * 0.2192, screenH * 0.4019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Premier", screenW * 0.3692, screenH * 0.4019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Holownik", screenW * 0.5292, screenH * 0.4019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Rancher", screenW * 0.6792, screenH * 0.4019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Stratum", screenW * 0.2192, screenH * 0.5019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("HPV1000", screenW * 0.3692, screenH * 0.5019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Cheetach", screenW * 0.5300, screenH * 0.5019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Sultan", screenW * 0.6780, screenH * 0.5019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Zarz?d", screenW *0.2192, screenH * 0.6019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Euros", screenW *0.3692, screenH * 0.6019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Maverick", screenW *0.5292, screenH * 0.6019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Zamknij Panel", screenW * 0.4492, screenH * 0.7219, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
end
local marker = createMarker(-1592.18, 713.42, -5.24-1.5,"cylinder",1.35,55,90,255)
local t=createElement("text")
setElementPosition(t,-1592.18, 713.42, -5.24+0.5)
setElementInterior(t,0)
setElementDimension(t,0)
setElementData(t,"name","Panel\nWirtualnego Parkingu\nPolicji")
oknoparkingu = false
function HitParking(he,md)
if he == localPlayer and getElementType(he) == "player" then else return end
if isPlayerInVehicle(he) then return end
if getElementData(he,"player:duty") == "SAPD" then
addEventHandler("onClientRender",root,pokazgui)
oknoparkingu = true
showCursor(true)
end
end
addEventHandler ( "onClientMarkerHit", marker, HitParking )
function Przechowyjmij(button, state)
if button == "left" and state == "down" and oknoparkingu then
if cursorPosition(screenW * 0.2192, screenH * 0.3019, screenW * 0.1094, screenH * 0.0600) then
if getElementData(localPlayer,"player:rank") < 1 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
triggerServerEvent("auto:asapd", root, localPlayer)
showCursor(false)
oknoparkingu = false
removeEventHandler ("onClientRender", root, pokazgui)
end
end
end
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)
function Przechowyjmij(button, state)
if button == "left" and state == "down" and oknoparkingu then
if cursorPosition(screenW * 0.3692, screenH * 0.3019, screenW * 0.1094, screenH * 0.0600) then
if getElementData(localPlayer,"player:rank") < 2 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
triggerServerEvent("auto:sapd", root, localPlayer)
showCursor(false)
oknoparkingu = false
removeEventHandler ("onClientRender", root, pokazgui)
end
end
end
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)
function Przechowyjmij(button, state)
if button == "left" and state == "down" and oknoparkingu then
if cursorPosition(screenW * 0.5292, screenH * 0.3019, screenW * 0.1094, screenH * 0.0600) then
if getElementData(localPlayer,"player:rank") < 2 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
triggerServerEvent("auto:sapd2", root, localPlayer)
showCursor(false)
oknoparkingu = false
removeEventHandler ("onClientRender", root, pokazgui)
end
end
end
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)
function Przechowyjmij(button, state)
if button == "left" and state == "down" and oknoparkingu then
if cursorPosition(screenW * 0.6792, screenH * 0.3019, screenW * 0.1094, screenH * 0.0600) then
if getElementData(localPlayer,"player:rank") < 1 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
triggerServerEvent("auto:merit", root, localPlayer)
showCursor(false)
oknoparkingu = false
removeEventHandler ("onClientRender", root, pokazgui)
end
end
end
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)
function Przechowyjmij(button, state)
if button == "left" and state == "down" and oknoparkingu then
if cursorPosition(screenW * 0.2192, screenH * 0.4019, screenW * 0.1094, screenH * 0.0600) then
if getElementData(localPlayer,"player:rank") < 2 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
triggerServerEvent("auto:enforcer", root, localPlayer)
showCursor(false)
oknoparkingu = false
removeEventHandler ("onClientRender", root, pokazgui)
end
end
end
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)
function Przechowyjmij(button, state)
if button == "left" and state == "down" and oknoparkingu then
if cursorPosition(screenW * 0.3692, screenH * 0.4019, screenW * 0.1094, screenH * 0.0600) then
if getElementData(localPlayer,"player:rank") < 2 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
triggerServerEvent("auto:premier", root, localPlayer)
showCursor(false)
oknoparkingu = false
removeEventHandler ("onClientRender", root, pokazgui)
end
end
end
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)
function Przechowyjmij(button, state)
if button == "left" and state == "down" and oknoparkingu then
if cursorPosition(screenW * 0.5292, screenH * 0.4019, screenW * 0.1094, screenH * 0.0600) then
if getElementData(localPlayer,"player:rank") < 1 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
triggerServerEvent("auto:holownik", root, localPlayer)
showCursor(false)
oknoparkingu = false
removeEventHandler ("onClientRender", root, pokazgui)
end
end
end
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)
function Przechowyjmij(button, state)
if button == "left" and state == "down" and oknoparkingu then
if cursorPosition(screenW * 0.6792, screenH * 0.4019, screenW * 0.1094, screenH * 0.0600) then
if getElementData(localPlayer,"player:rank") < 2 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
triggerServerEvent("auto:rancher", root, localPlayer)
showCursor(false)
oknoparkingu = false
removeEventHandler ("onClientRender", root, pokazgui)
end
end
end
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)
function Przechowyjmij(button, state)
if button == "left" and state == "down" and oknoparkingu then
if cursorPosition(screenW * 0.2192, screenH * 0.5019, screenW * 0.1094, screenH * 0.0600) then
if getElementData(localPlayer,"player:rank") < 2 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
triggerServerEvent("auto:solair", root, localPlayer)
showCursor(false)
oknoparkingu = false
removeEventHandler ("onClientRender", root, pokazgui)
end
end
end
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)
function Przechowyjmij(button, state)
if button == "left" and state == "down" and oknoparkingu then
if cursorPosition(screenW * 0.3692, screenH * 0.5019, screenW * 0.1094, screenH * 0.0600) then
if getElementData(localPlayer,"player:rank") < 2 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
triggerServerEvent("auto:hpv1000", root, localPlayer)
showCursor(false)
oknoparkingu = false
removeEventHandler ("onClientRender", root, pokazgui)
end
end
end
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)
addEventHandler ( "onClientMarkerHit", marker, HitParking )
-------------------NOWE POJAZDY--------------------------
function Przechowyjmij(button, state)
if button == "left" and state == "down" and oknoparkingu then
if cursorPosition(screenW * 0.5300, screenH * 0.5019, screenW * 0.1094, screenH * 0.0600) then
if getElementData(localPlayer,"player:rank") < 1 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
triggerServerEvent("auto:sapd11", root, localPlayer)
showCursor(false)
oknoparkingu = false
removeEventHandler ("onClientRender", root, pokazgui)
end
end
end
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)
--------------------------------------------------------------------------------
function Przechowyjmij(button, state)
if button == "left" and state == "down" and oknoparkingu then
if cursorPosition(screenW * 0.6780, screenH * 0.5019, screenW * 0.1094, screenH * 0.0600) then
if getElementData(localPlayer,"player:rank") < 1 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
triggerServerEvent("auto:sapd12", root, localPlayer)
showCursor(false)
oknoparkingu = false
removeEventHandler ("onClientRender", root, pokazgui)
end
end
end
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)
function Przechowyjmij(button, state)
if button == "left" and state == "down" and oknoparkingu then
if cursorPosition(screenW *0.2192, screenH * 0.6019, screenW * 0.1094, screenH * 0.0600) then
if getElementData(localPlayer,"player:rank") < 2 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
triggerServerEvent("auto:zarzad", root, localPlayer)
showCursor(false)
oknoparkingu = false
removeEventHandler ("onClientRender", root, pokazgui)
end
end
end
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)
function Przechowyjmij(button, state)
if button == "left" and state == "down" and oknoparkingu then
if cursorPosition(screenW *0.3692, screenH * 0.6019, screenW * 0.1094, screenH * 0.0600) then
if getElementData(localPlayer,"player:rank") < 2 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
triggerServerEvent("auto:Euros", root, localPlayer)
showCursor(false)
oknoparkingu = false
removeEventHandler ("onClientRender", root, pokazgui)
end
end
end
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)
function Przechowyjmij(button, state)
if button == "left" and state == "down" and oknoparkingu then
if cursorPosition(screenW *0.5292, screenH * 0.6019, screenW * 0.1094, screenH * 0.0600) then
if getElementData(localPlayer,"player:rank") < 2 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
triggerServerEvent("auto:Mave", root, localPlayer)
showCursor(false)
oknoparkingu = false
removeEventHandler ("onClientRender", root, pokazgui)
end
end
end
addEventHandler("onClientClick", getRootElement(), Przechowyjmij)
function Zamknij(button, state)
if button == "left" and state == "down" and oknoparkingu then
if cursorPosition(screenW * 0.4492, screenH * 0.7219, screenW * 0.1094, screenH * 0.0600) then
removeEventHandler ("onClientRender", root, pokazgui)
showCursor(false)
oknoparkingu = false
end
end
end
addEventHandler("onClientClick", getRootElement(), Zamknij)
function cursorPosition(x, y, w, h)
if (not isCursorShowing()) then
return false
end
local mx, my = getCursorPosition()
local fullx, fully = guiGetScreenSize()
cursorx, cursory = mx*fullx, my*fully
if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
return true
else
return false
end
end
--[[
function close()
if source ~= button.zamknij then return end
zmienna = false
guiSetVisible(button.zamknij,false)
guiSetVisible(button.asapd,false)
guiSetVisible(button.sapd,false)
guiSetVisible(button.premier,false)
guiSetVisible(button.Sultan,false)
guiSetVisible(button.bullet,false)
guiSetVisible(button.rancher ,false)
guiSetVisible(button.swat,false)
guiSetVisible(button.rumpo,false)
guiSetVisible(button.enforcer,false)
guiSetVisible(button.cheetach,false)
guiSetVisible(button.holownik,false)
showCursor(false,false)
end
addEventHandler ( "onClientGUIClick", root,close)
addEventHandler ( "onClientGUIClick", root,vehasapd)
function vehsapd()
if source ~= button.sapd then return end
if getElementData(localPlayer,"player:rank") <= 3 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
--if getElementData(localPlayer,"player:faction") >= 3 then
triggerServerEvent("auto:sapd", root, localPlayer)
zmienna = false
guiSetVisible(button.zamknij,false)
guiSetVisible(button.asapd,false)
guiSetVisible(button.sapd,false)
guiSetVisible(button.premier,false)
guiSetVisible(button.Sultan,false)
guiSetVisible(button.bullet,false)
guiSetVisible(button.rancher ,false)
guiSetVisible(button.swat,false)
guiSetVisible(button.rumpo,false)
guiSetVisible(button.enforcer,false)
guiSetVisible(button.cheetach,false)
guiSetVisible(button.holownik,false)
showCursor(false,false)
--end
end
addEventHandler ( "onClientGUIClick", root,vehsapd)
function vehpremier()
if source ~= button.premier then return end
if getElementData(localPlayer,"player:rank") <= 5 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
-- if getElementData(localPlayer,"player:faction") >= 5 then
triggerServerEvent("auto:premier", root, localPlayer)
zmienna = false
guiSetVisible(button.zamknij,false)
guiSetVisible(button.asapd,false)
guiSetVisible(button.sapd,false)
guiSetVisible(button.premier,false)
guiSetVisible(button.Sultan,false)
guiSetVisible(button.bullet,false)
guiSetVisible(button.rancher ,false)
guiSetVisible(button.swat,false)
guiSetVisible(button.rumpo,false)
guiSetVisible(button.enforcer,false)
guiSetVisible(button.cheetach,false)
guiSetVisible(button.holownik,false)
showCursor(false,false)
-- end
end
addEventHandler ( "onClientGUIClick", root,vehpremier)
function vehSultan()
if source ~= button.Sultan then return end
if getElementData(localPlayer,"player:rank") <= 15 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
--if getElementData(localPlayer,"player:faction") >= 15 then
triggerServerEvent("auto:Sultan", root, localPlayer)
zmienna = false
guiSetVisible(button.zamknij,false)
guiSetVisible(button.asapd,false)
guiSetVisible(button.sapd,false)
guiSetVisible(button.premier,false)
guiSetVisible(button.Sultan,false)
guiSetVisible(button.bullet,false)
guiSetVisible(button.rancher ,false)
guiSetVisible(button.swat,false)
guiSetVisible(button.rumpo,false)
guiSetVisible(button.enforcer,false)
guiSetVisible(button.cheetach,false)
guiSetVisible(button.holownik,false)
showCursor(false,false)
-- end
end
addEventHandler ( "onClientGUIClick", root,vehSultan)
function vehbullet()
if source ~= button.bullet then return end
if getElementData(localPlayer,"player:rank") <= 20 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
-- if getElementData(localPlayer,"player:faction") >= 20 then
triggerServerEvent("auto:bullet", root, localPlayer)
zmienna = false
guiSetVisible(button.zamknij,false)
guiSetVisible(button.asapd,false)
guiSetVisible(button.sapd,false)
guiSetVisible(button.premier,false)
guiSetVisible(button.Sultan,false)
guiSetVisible(button.bullet,false)
guiSetVisible(button.rancher ,false)
guiSetVisible(button.swat,false)
guiSetVisible(button.rumpo,false)
guiSetVisible(button.enforcer,false)
guiSetVisible(button.cheetach,false)
guiSetVisible(button.holownik,false)
showCursor(false,false)
-- end
end
addEventHandler ( "onClientGUIClick", root,vehbullet)
function vehrancher()
if source ~= button.rancher then return end
if getElementData(localPlayer,"player:rank") <= 4 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
-- if getElementData(localPlayer,"player:faction") >= 4 then
triggerServerEvent("auto:rancher", root, localPlayer)
zmienna = false
guiSetVisible(button.zamknij,false)
guiSetVisible(button.asapd,false)
guiSetVisible(button.sapd,false)
guiSetVisible(button.premier,false)
guiSetVisible(button.Sultan,false)
guiSetVisible(button.bullet,false)
guiSetVisible(button.rancher ,false)
guiSetVisible(button.swat,false)
guiSetVisible(button.rumpo,false)
guiSetVisible(button.enforcer,false)
guiSetVisible(button.cheetach,false)
guiSetVisible(button.holownik,false)
showCursor(false,false)
-- end
end
addEventHandler ( "onClientGUIClick", root,vehrancher)
function vehswat()
if source ~= button.swat then return end
if getElementData(localPlayer,"player:rank") >= 15 then
triggerServerEvent("auto:swat", root, localPlayer)
zmienna = false
guiSetVisible(button.zamknij,false)
guiSetVisible(button.asapd,false)
guiSetVisible(button.sapd,false)
guiSetVisible(button.premier,false)
guiSetVisible(button.Sultan,false)
guiSetVisible(button.bullet,false)
guiSetVisible(button.rancher ,false)
guiSetVisible(button.swat,false)
guiSetVisible(button.rumpo,false)
guiSetVisible(button.enforcer,false)
guiSetVisible(button.cheetach,false)
guiSetVisible(button.holownik,false)
showCursor(false,false)
end
end
addEventHandler ( "onClientGUIClick", root,vehswat)
function vehrumpo()
if source ~= button.rumpo then return end
if getElementData(localPlayer,"player:rank") <= 10 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
triggerServerEvent("auto:rumpo", root, localPlayer)
zmienna = false
guiSetVisible(button.zamknij,false)
guiSetVisible(button.asapd,false)
guiSetVisible(button.sapd,false)
guiSetVisible(button.premier,false)
guiSetVisible(button.Sultan,false)
guiSetVisible(button.bullet,false)
guiSetVisible(button.rancher ,false)
guiSetVisible(button.swat,false)
guiSetVisible(button.rumpo,false)
guiSetVisible(button.enforcer,false)
guiSetVisible(button.cheetach,false)
guiSetVisible(button.holownik,false)
showCursor(false,false)
end
addEventHandler ( "onClientGUIClick", root,vehrumpo)
function vehenforcer()
if source ~= button.enforcer then return end
if getElementData(localPlayer,"player:rank") >= 10 then
triggerServerEvent("auto:enforcer", root, localPlayer)
zmienna = false
guiSetVisible(button.zamknij,false)
guiSetVisible(button.asapd,false)
guiSetVisible(button.sapd,false)
guiSetVisible(button.premier,false)
guiSetVisible(button.Sultan,false)
guiSetVisible(button.bullet,false)
guiSetVisible(button.rancher ,false)
guiSetVisible(button.swat,false)
guiSetVisible(button.rumpo,false)
guiSetVisible(button.enforcer,false)
guiSetVisible(button.cheetach,false)
guiSetVisible(button.holownik,false)
showCursor(false,false)
end
end
addEventHandler ( "onClientGUIClick", root,vehenforcer)
function vehhol()
if source ~= button.holownik then return end
if getElementData(localPlayer,"player:rank") <= 0 then
outputChatBox("#3399ff[Parking] #66ccffNie mo?esz u?ywa? tego pojazdu!", 255, 0, 0, true) return end
-- if getElementData(localPlayer,"player:faction") <= 1 then
triggerServerEvent("auto:holownik", root, localPlayer)
zmienna = false
guiSetVisible(button.zamknij,false)
guiSetVisible(button.asapd,false)
guiSetVisible(button.sapd,false)
guiSetVisible(button.premier,false)
guiSetVisible(button.Sultan,false)
guiSetVisible(button.bullet,false)
guiSetVisible(button.rancher ,false)
guiSetVisible(button.swat,false)
guiSetVisible(button.rumpo,false)
guiSetVisible(button.enforcer,false)
guiSetVisible(button.cheetach,false)
guiSetVisible(button.holownik,false)
showCursor(false,false)
-- end
end
addEventHandler ( "onClientGUIClick", root,vehhol)]]