local markerstart = createMarker ( 1941.18, 2168.42, 9.82,"cylinder",1,255,255,255)
GUIEditor = {
button = {},
window = {},
memo = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
okno = guiCreateWindow(1058, 245, 298, 513, "Kurier", false)
guiWindowSetSizable(okno, false)
memo = guiCreateLabel(9, 33, 279, 297, "Praca kuriera polega na rozwo?eniu paczek do klient?w, aby dosta? wyp??te musisz rozwie?? minimum 5 paczek", false, okno)
guiLabelSetHorizontalAlign(memo, "left", true)
zatrudnij = guiCreateButton(11, 340, 277, 44, "Zatrudnij si?", false, okno)
zwolnij = guiCreateButton(11, 394, 277, 44, "Zwolnij si?", false, okno)
wroc = guiCreateButton(11, 448, 277, 55, "Wr??", false, okno)
end
)
addEventHandler("onClientResourceStart", resourceRoot,
function()
guiSetVisible(okno, false)
guiSetVisible(memo, false)
guiSetVisible(zatrudnij,false)
guiSetVisible(zwolnij,false)
guiSetVisible(wroc, false)
showCursor(false)
end
)
addEventHandler("onClientMarkerHit",markerstart,function(el,md)
if not md or el~=localPlayer then return end
guiSetVisible(okno, true)
guiSetVisible(memo, true)
guiSetVisible(zatrudnij, true)
guiSetVisible(zwolnij, true)
guiSetVisible(wroc, true)
showCursor(true)
end)
function wylaczoknopraca()
if source == wroc then
guiSetVisible(okno, false)
guiSetVisible(memo, false)
guiSetVisible(zatrudnij, false)
guiSetVisible(zwolnij, false)
guiSetVisible(wroc, false)
showCursor(false)
end
end
addEventHandler("onClientGUIClick", root, wylaczoknopraca)
marker = nil
addEventHandler("onClientVehicleExit", root, function(plr, seat)
if seat == 0 then
if praca == 1 then
local x,y,z = getVehicleComponentPosition(source, "boot_dummy", "world")
marker = createMarker(x,y,z, "cylinder", 3.0, 255, 0, 0, 150)
attachElements ( marker, boot_dummy, 0 -2, 0, 0 )
end
end
end)
addEventHandler("onClientVehicleEnter", root, function(plr, seat)
if seat == 0 then
if marker and isElement(marker) then
destroyElement(marker)
end
end
end)
function startpraca()
if source == zatrudnij then
praca = 1
outputChatBox("Rozpoczo?e? prace", source)
end
end
addEventHandler("onClientGUIClick", root, startpraca)