local marker=createMarker(358.26,185.35,1008.38-0.9, "cylinder", 1, 255, 255, 255, 155)
setElementInterior(marker, 3)
local screenW, screenH = guiGetScreenSize()
panelorga = false
function PanelUrzad4()
local Alpha, Alpha2 = interpolateBetween(0, 0, 0, 255, 180, 0, ((getTickCount() - tickorga) / 2500), "Linear")
dxDrawImage(screenW * 0.0743, screenH * 0.0804, screenW * 0.9400, screenH * 0.8352, ":ogrpg-core/okn.png", 0, 0, 0, tocolor(0, 0, 0, Alpha2), false)
dxDrawText("PRZEPISYWANIE POJAZDOW NA ORGANIZACJE!", screenW * 0.1038, screenH * 0.2702, screenW * 0.9625, screenH * 0.1500, tocolor(255,0,0), 3.00, "default", "center", "center", false, false, false, false, false)
end
local wmor={}
wmor.window=guiCreateStaticImage(0.12, 0.037, 0.84, 0.9, ":ogrpg-core/okn1.png", true)
guiSetVisible(wmor.window, false)
wmor.label=guiCreateLabel(0.02, 0.19, 0.96, 0.05, "Z ponizszej listy wybierz pojazd ktory chesz przepisac na organizacje a nastepnie kliknij przycisk Przepisz/Wypisz", true, wmor.window)
guiLabelSetHorizontalAlign(wmor.label, "center", false)
guiLabelSetVerticalAlign(wmor.label, "center")
wmor.gridlist=guiCreateGridList(0.25, 0.23, 0.53, 0.5, true, wmor.window)
guiGridListAddColumn(wmor.gridlist, "ID", 0.2)
guiGridListAddColumn(wmor.gridlist, "Nazwa", 0.5)
guiGridListAddColumn(wmor.gridlist, "Organizacja", 0.5)
wmor.submit=guiCreateButton(0.04, 0.74, 0.27, 0.11, "Przepisz / Wypisz", true, wmor.window)
wmor.close=guiCreateButton(0.68, 0.74, 0.28, 0.11, "Zamknij Panel", true, wmor.window)
addEventHandler("onClientGUIClick", root, function(btn,state)
if source == wmor.submit then
local selectedRow=guiGridListGetSelectedItem(wmor.gridlist)
if selectedRow < 0 then return end
local id=tostring(guiGridListGetItemText(wmor.gridlist, selectedRow, 1))
local name=tostring(guiGridListGetItemText(wmor.gridlist, selectedRow, 2))
triggerServerEvent("org:check", resourceRoot, id, name)
end
if source == wmor.close then
if guiGetVisible(wmor.window) == true then
showCursor(false)
removeEventHandler("onClientRender",root,PanelUrzad4)
panelorga = false
guiSetVisible(wmor.window, false)
end
end
end)
addEvent("org:refresh", true)
addEventHandler("org:refresh", resourceRoot, function(result)
guiGridListClear(wmor.gridlist)
for i,v in pairs(result) do
if string.len(v.plateText) < 1 then v.plateText="Brak" end
local row=guiGridListAddRow(wmor.gridlist)
if tostring(v.ownedGroup) == "0" then v.ownedGroup = "Brak" end
guiGridListSetItemText(wmor.gridlist, row, 1, v.id, false, false)
guiGridListSetItemText(wmor.gridlist, row, 2, getVehicleNameFromModel(v.model), false, false)
guiGridListSetItemText(wmor.gridlist, row, 3, v.ownedGroup , false, false)
end
end)
addEventHandler("onClientMarkerHit", marker, function(el,md)
if el~=localPlayer then return end
if not getElementData(el,"player:organization") then outputChatBox("* Nie posiadasz organizacji!") return end
if not guiGetVisible(wmor.gridlist) then
tickorga = getTickCount()
panelorga = true
addEventHandler("onClientRender",root,PanelUrzad4)
guiSetVisible(wmor.window, true)
showCursor(true)
triggerServerEvent("org:download", resourceRoot, el)
end
end)