Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2015-12-11, 15:30


GamerHD11







Wiek: 24
Na forum: 4260 dni
Posty: 259
Nick w MP: SzokoHD

Piwa: 23

Respekt: 50

M?j problem jest taki, ?e gdy ko?cz? prac? i id? po drugi kurs to po klikni?ciu przycisku "Zatrudnij Si?" auto si? nie pojawia. Pomocy.


Client:

local marker createMarker(642.662351238.5338110.66666"cylinder"200255200)
znak createBlip(642.662351238.5338110.6666652)

        okno guiCreateWindow(753244408594"Praca Przewo?nika Ropy"false)
        guiWindowSetSizable(oknofalse)

        opis guiCreateMemo(925389365"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."falseokno)
        guiMemoSetReadOnly(opistrue)
        btnzat guiCreateButton(1140538759"Zatrudnij si?"falseokno)
        btnzwol guiCreateButton(1148338763"Zwolnij si?"falseokno)
        zamknij guiCreateButton(3475645120"X"falseokno)
    guiSetVisible(oknofalse)

function showGUI(hitElement)
if getElementType(hitElement) == "player" and (hitElement == localPlayerthen
if not guiGetVisible(oknothen
if not getPedOccupiedVehicle(localPlayerthen
guiSetVisible(oknotrue)
showCursor(true)
end
end
end
end
addEventHandler("onClientMarkerHit"markershowGUI)

function hideGUI()
guiSetVisible(oknofalse)
showCursor(false)
end
addEventHandler("onClientGUIClick"zamknijhideGUI)

function acceptJob()
if getElementData(localPlayer"pracador") == "Brak" then
blip createBlip(422.269381448.285036.2023941)
marker1 createMarker(422.269381448.285035.20239"cylinder"402550200)
addEventHandler("onClientMarkerHit"marker1getRope)
guiSetVisible(oknofalse)
showCursor(false)
setElementData(localPlayer"pracador""Przewoziciel Ropy")
triggerServerEvent("zatrudnijSie",localPlayerlocalPlayerauto)
outputChatBox("Wejd? do pojazdu i wjed? w marker, kt?ry oznaczony jest na mapie."255255255)
else
outputChatBox("Posiadasz ju? aktywn? prac? dorywcz?."255255255)
end
end
addEventHandler("onClientGUIClick"btnzatacceptJob)

function exitJob()
guiSetVisible(oknofalse)
showCursor(false)
setElementData(localPlayer"pracador""Brak")
outputChatBox("Zako?czy?e? prac?: Przewoziciela Ropy."255255255)
end
addEventHandler("onClientGUIClick"btnzwolexitJob)

function getRope(hitElement)
if getElementType(hitElement) == "player" and (hitElement == localPlayerthen
auto getPedOccupiedVehicle(localPlayer)
outputChatBox("?adowanie Ropy........"255255255)
setElementFrozen(autotrue)
rnd math.random(3065)
setElementData(localPlayer"iloscropy"rnd)
ropa getElementData(localPlayer"iloscropy")
setTimer(function()
setElementFrozen(autofalse)
destroyElement(marker1)
destroyElement(blip)
blip1 createBlip(601.582341242.8319111.7187541)
marker2 createMarker(601.582341242.8319110.71875"cylinder"402550200)
addEventHandler("onClientMarkerHit"marker2reloadRope)
outputChatBox("Ropa zosta?a za?adowana w ilo?ci: "..ropa.." Litr?w."255255255)
outputChatBox("Jed? do zbiornika ropy, aby prze?adowa? surowiec mineralny z cysterny do Poci?gu. Oznaczony jest blipem na mapie."255255255)
end50001)
end
end

function reloadRope(hitElement)
auto getPedOccupiedVehicle(localPlayer)
if getElementType(hitElement) == "player" and (hitElement == localPlayerthen
if auto then
setElementFrozen(autotrue)
outputChatBox("Wejd? w marker oraz kliknij przycisk PRZE?ADUJ aby by?o mo?liwe prze?adowanie ropy."255255255)
marker3 createMarker(601.672001249.8303210.71875"cylinder"10255255200)
addEventHandler("onClientMarkerHit"marker3showGUIRope)
end
end
end

okno1 guiCreateWindow(762327355513"Zbiornik Ropy"false)
guiWindowSetSizable(okno1false)
btnprze guiCreateButton(1022732773"Prze?aduj"falseokno1)
memo1 guiCreateMemo(929328112"Po prze?adowaniu Ropy jed? do koncernu naftowego aby przerobi? rop? na paliwo, kt?re dowieziesz potem na stacj?."falseokno1)

guiMemoSetReadOnly(memo1true)
guiSetVisible(okno1false)

function showGUIRope(hitElement)
if getElementType(hitElement) == "player" and (hitElement == localPlayerthen
if not guiGetVisible(okno1then
guiSetVisible(okno1true)
showCursor(true)
end
end
end

function reloadingRope()
auto getPedOccupiedVehicle(localPlayer)
if not auto then
setElementFrozen(localPlayertrue)
outputChatBox("Prze?adowywanie Ropy......."255255255)
setTimer(function()
destroyElement(marker2)
destroyElement(marker3)
destroyElement(blip1)
marker4 createMarker(741.129701985.703494.34257"cylinder"5,2550200)
addEventHandler("onClientMarkerHit"marker4paliwo)
blip2 createBlip(741.129701985.703495.3425741)
setElementFrozen(localPlayerfalse)
guiSetVisible(okno1false)
showCursor(false)
triggerServerEvent("createTrain"localPlayerlocalPlayerpociag)
outputChatBox("Jed? do koncernu naftowego aby przerobi? rop?."255255255)
end50001)
end
end
addEventHandler("onClientGUIClick"btnprzereloadingRope)

function paliwo(hitElement)
auto getPedOccupiedVehicle(localPlayer)
if getElementType(hitElement) == "player" and (hitElement == localPlayerthen
if auto then
destroyElement(marker4)
destroyElement(blip2)
marker5 createMarker(577.211911269.7736811.59429"cylinder"502550200)
addEventHandler("onClientMarkerHit"marker5przeladuj2)
blip3 createBlip(636.906801253.7430411.6401641)
outputChatBox("Paliwo jest ju? gotowe i za?adowane na tw?j poci?g. Jed? do zbiornika, aby prze?adowa? paliwo do cysterny."255255255)
end
end
end

function przeladuj2(hitElement)
if getElementType(hitElement) == "player" and (hitElement == localPlayerthen
if auto then
destroyElement(marker5)
destroyElement(blip3)
triggerServerEvent("zaladunekPaliwa"localPlayerlocalPlayerauto1)
outputChatBox("Jed? na stacj? paliw, aby dostarczy? paliwo do dystrybutora."255255255)
marker6 createMarker(23.252031175.0668918.40798"cylinder"3,2550200)
addEventHandler("onClientMarkerHit"marker6addFuel)
blip4 createBlip(23.252031175.0668919.4079841)
end
end
end

function addFuel(hitElement)
if getElementType(hitElement) == "player" and (hitElement == localPlayerthen
if auto then
auto getPedOccupiedVehicle(localPlayer)
outputChatBox("Roz?adowywanie paliwa na stacje paliw. Prosz? czeka? 15 sekund."255255255)
setElementFrozen(autotrue)
setTimer(function()
rnd math.random(4565)
setElementFrozen(autofalse)
givePlayerMoney(rnd)
destroyElement(marker6)
destroyElement(blip4)
outputChatBox("Po zako?czonym kursie otrzyma?e? "..rnd.." $ oraz doda?e? do dystrybutora "..ropa.." L."255255255)
triggerServerEvent("endDestroy"localPlayerlocalPlayer)
setElementData(localPlayer"iloscropy"0)
setElementData(localPlayer"pracador""Brak")
end150001)
end
end
end



Server:

addEvent("zatrudnijSie"true)
addEventHandler("zatrudnijSie"getRootElement(), function(thePlayer)
auto createVehicle(573636.906801253.7430411.64016)
warpPedIntoVehicle(thePlayerauto)
setElementData(auto"fuel"60)
setElementData(auto"przebieg"0)
end)

addEvent("createTrain"true)
addEventHandler("createTrain"getRootElement(), function(thePlayer)
pociag createVehicle(538577.211911269.7736811.59429)
setElementData(pociag"fuel"60)
setElementData(pociag"przebieg"0)
setElementCollisionsEnabled(pociagfalse)
warpPedIntoVehicle(thePlayerpociag)
end)

addEvent("zaladunekPaliwa"true)
addEventHandler("zaladunekPaliwa"getRootElement(), function(thePlayer)
destroyElement(pociag)
auto1 createVehicle(573580.137211218.6889611.71127)
setElementData(auto1"fuel"60)
setElementData(auto1"przbieg"0)
warpPedIntoVehicle(thePlayerauto1)
end)

addEvent("endDestroy"true)
addEventHandler("endDestroy"getRootElement(), function(thePlayer)
destroyElement(auto1)
setElementPosition(thePlayer619.475951227.5068411.71875)
end)

function destroyVehicle(vehicleseatjacked)
if ( getVehicleID (vehicle) == 573 then
if ( getVehicleID(vehicle) == 538 then
destroyElement(vehicle)
end
end
end
addEventHandler("onPlayerVehicleExit"getRootElement(), destroyVehicle)


[ Dodano: 2015-12-12, 20:25 ]
Pomo?e kto? ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-13, 10:17


krisu477







Wiek: 25
Na forum: 4837 dni
Posty: 54
Nick w MP: Krisek

Piwa: 7

Respekt: 70

jakie? b??dy? wszystko inne si? pojawia?

Postaw piwo autorowi tego posta
 

 
Tagi: koniec :: pracy
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Koniec Pracy Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku