local screenW, screenH = guiGetScreenSize()
local marker=createMarker(-1968.79, 620.47, 35.17-0.9, "cylinder", 2, 255,255,255,50)
local sphere=createColCuboid(-1966.6160888672, 613.84454345703, 33.78190612793, 14.4, 7.3, 6.2)
local t=createElement("text")
setElementData(t,"scale",1.5)
setElementData(t,"name","Odbi?r pojazd?w")
setElementPosition(t,-1968.79, 620.47, 35.17)
local wm={}
wm.window=guiCreateWindow(0.25, 0.26, 0.51, 0.42, "Odbieranie pojazd?w", true)
guiWindowSetSizable(wm.window, false)
guiWindowSetMovable(wm.window, false)
guiSetVisible(wm.window, false)
wm.gridlist=guiCreateGridList(0.04, 0.09, 0.92, 0.65, true, wm.window)
guiGridListAddColumn(wm.gridlist, "ID", 0.2)
guiGridListAddColumn(wm.gridlist, "Pojazd", 0.55)
guiGridListAddColumn(wm.gridlist, "Organizacja", 0.2)
wm.submit=guiCreateButton(0.04, 0.76, 0.47, 0.19, "Wyjmij pojazd", true, wm.window)
wm.close=guiCreateButton(0.57, 0.75, 0.39, 0.20, "Zamknij", true, wm.window)
addEvent("onParkingGetVehicles", true)
addEventHandler("onParkingGetVehicles", root, function(result)
guiGridListClear(wm.gridlist)
if not result then return end
for i,v in pairs(result) do
if v["player:organization"] == "false" then
v["player:organization"] = "NIE"
else
v["player:organization"] = "TAK"
end
local row=guiGridListAddRow(wm.gridlist)
guiGridListSetItemText(wm.gridlist, row, 1, v["id"], false, false)
guiGridListSetItemText(wm.gridlist, row, 2, getVehicleNameFromModel(v["model"]), false, false)
guiGridListSetItemText(wm.gridlist, row, 3, v["player:organization"], false, false)
end
end)
addEventHandler("onClientMarkerHit", marker, function(el,md)
if el~=localPlayer then return end
if isPedInVehicle(el) then return end
if guiGetVisible(wm.window) == false then
showCursor(true)
guiSetVisible(wm.window,true)
triggerServerEvent("onParkingGetRekords", localPlayer)
--etCameraMatrix(-2056.26, 468.77, 38.49, -2048.08, 467.73, 35.17)
end
end)