local marker = createMarker(642.66235, 1238.53381, 10.66666, "cylinder", 2, 0, 0, 255, 200)
okno = guiCreateWindow(753, 244, 408, 594, "Praca Przewo?nika Ropy", false)
guiWindowSetSizable(okno, false)
opis = guiCreateMemo(9, 25, 389, 365, "Praca polega na dowo?eniu paliwa na stacji poprzez wydobycie i za?adowanie do auta ropy, prze?adunek ropy z samochodu do poci?gu, przew?z paliwa poci?giem do Koncernu Naftowego, ponowny przyjazd do zbiornika z rop? i przew?z przerobionej ropy na benzyne do stacji paliw. Za jeden taki kurs dostaje si? od 90 do 110 $, a tak?e wzbogaca si? dystrybutor z paliwem od 150 do 300 litr?w paliwa.", false, okno)
guiMemoSetReadOnly(opis, true)
btnzat = guiCreateButton(11, 405, 387, 59, "Zatrudnij si?", false, okno)
btnzwol = guiCreateButton(11, 483, 387, 63, "Zwolnij si?", false, okno)
zamknij = guiCreateButton(347, 564, 51, 20, "X", false, okno)
guiSetVisible(okno, false)
function showGUI(hitElement)
if getElementType(hitElement) == "player" and (hitElement == localPlayer) then
if not guiGetVisible(okno) then
if not getPedOccupiedVehicle(localPlayer) then
guiSetVisible(okno, true)
showCursor(true)
end
end
end
end
addEventHandler("onClientMarkerHit", marker, showGUI)
function hideGUI()
guiSetVisible(okno, false)
showCursor(false)
end
addEventHandler("onClientGUIClick", zamknij, hideGUI)
function acceptJob()
blip = createBlip(422.26938, 1448.28503, 6.20239, 41)
marker1 = createMarker(422.26938, 1448.28503, 5.20239, "cylinder", 4, 0, 255, 0, 200)
guiSetVisible(okno, false)
showCursor(false)
setElementData(localPlayer, "pracador", "Przewoziciel Ropy")
triggerServerEvent("zatrudnijSie",localPlayer, localPlayer, auto)
outputChatBox("Wejd? do pojazdu i wjed? w marker, kt?ry oznaczony jest na mapie.", 255, 255, 255)
end
addEventHandler("onClientGUIClick", btnzat, acceptJob)
function getRope(localPlayer)
outputChatBox("?adowanie Ropy........", 255, 255, 255)
setElementFrozen(localPlayer, true)
setTimer(function()
rnd = random.math(150, 300)
setElementFrozen(localPlayer, false)
destroyElement(marker1)
destroyElement(blip)
blip1 = createBlip(601.58234, 1242.83191, 11.71875, 41)
marker2 = createMarker(601.58234, 1242.83191, 10.71875, "cylinder", 4, 0, 255, 0, 200)
outputChatBox("Ropa zosta?a za?adowana w ilo?ci: "..rnd.." Litr?w.", 255, 255, 255)
outputChatBox("Jed? do zbiornika ropy, aby prze?adowa? surowiec mineralny z cysterny do Poci?gu. Oznaczony jest blipem na mapie.", 255, 255, 255)
triggerServerEvent("createTrain",localPlayer, localPlayer, pociag)
end, 5000, 1)
end
end
addEventHandler("onClientMarkerHit", marker1, getRope)