towar = createMarker(-2115.8623046875, -145.0595703125, 35.3203125-1, "cylinder", 1.5, 255, 255, 0, 170)
Window = guiCreateLabel(415, 159, 527, 414, "", false)
lista = guiCreateGridList(143, 65, 241, 296, false, Window)
towaryc = guiGridListAddColumn(lista, "TOWAR", 0.5)
cenac = guiGridListAddColumn(lista, "CENA", 0.5)
zamknij = guiCreateLabel(172, 378, 190, 30, "ZAMKNIJ", false, Window)
guiSetFont(zamknij, "default-bold-small")
guiLabelSetColor(zamknij, 49, 49, 49)
guiLabelSetHorizontalAlign(zamknij, "center", false)
guiLabelSetVerticalAlign(zamknij, "center")
guiSetVisible(Window, false)
function click()
veh = createVehicle ( 482, -2116.4306640625, -134.5302734375, 35.3203125-1 )
end
local towary={
{"Smieci","100"},
{"Pud?‚a","120"},
{"Dywany","150"}
}
for k, v in ipairs(towary) do
row = guiGridListAddRow ( lista )
guiGridListSetItemText ( lista, row, towaryc, v[1], false, false )
guiGridListSetItemText ( lista, row, cenac, v[2], false, false )
local selectedRow = guiGridListGetSelectedItem(lista) or -1
addEventHandler ( "onClientDoubleGUIClick", selectedRow, click )
if selectedRow < 0 then return end
end
function dx()
dxDrawRectangle(416, 159, 526, 414, tocolor(0, 0, 0, 250), false)
dxDrawRectangle(557, 160, 244, 55, tocolor(255, 255, 255, 255), false)
dxDrawText("HIGH LIFE TOWARY", 556, 160, 801, 215, tocolor(0, 0, 0, 250), 2.00, "default-bold", "center", "center", false, false, false, false, false)
dxDrawRectangle(556, 221, 245, 301, tocolor(49, 49, 49, 50), false)
dxDrawRectangle(588, 537, 190, 30, tocolor(255, 255, 255, 255), false)
end
function towarf()
addEventHandler("onClientRender", root, dx)
guiSetVisible(Window, true)
showCursor(true,true)
end
addEventHandler ( "onClientMarkerHit", towar, towarf )
function asd()
if source == zamknij then
removeEventHandler("onClientRender", root, dx)
guiSetVisible(Window, false)
showCursor(false,false)
end
end
addEventHandler ( "onClientGUIClick", root, asd )