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

Wysłany: 2016-03-09, 17:18


Emm

***** ***






Wiek: 32
Na forum: 3880 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6162

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Spr?buj tak
Strona serwera:
addEvent("givePlayerMoney"true)
addEventHandler("givePlayerMoney"resourceRoot, function(m)
if tonumber(mthen
  givePlayerMoney(clientm)
end
end)


createBlip (-1992.6562576.960937527.74731063842852)
local m1 createMarker(-1992.6562576.960937527.747310638428"cylinder"4.025500)
vehs = {}


function removePreviousVehicles(plr)
for i,v in ipairs(getElementsByType("vehicle"resourceRoot)) do
local sby getElementData(v"zrespilGracz")
if sby and sby == plr and getPedOccupiedVehicle(plr) ~= v then
destroyElement(v)
end
end
end

addEventHandler("onMarkerHit"m1, function(elmd)
if getElementData(el"zrespilGracz"then
outputChatBox("praca w tworzeniu..."el)
return
end

if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(elthen return end

local x,y,getElementPosition(el)
local bus createVehicle(597x,y,z,-1992.338867187575.389648437527.813388824463)

setElementData(bus"zrespilGracz"el)
setElementData(bus"pojazd_paliwo"50)
setElementData(bus"pojazd_przebieg"100)

warpPedIntoVehicle(elbus)
removePreviousVehicles(el)
triggerClientEvent(el"STARTJobBus"resourceRootbus)

vehs[el] = bus
end)

addEvent("STOPJobBus"true)
addEventHandler("STOPJobBus"resourceRoot, function()
local pojazd getPedOccupiedVehicle(localPlayer)
if pojazd then
destroyElement(pojazd)
end
end)

addEvent("destroyVeh"true)
addEventHandler("destroyVeh"getRootElement(),
function()
if vehs[sourcethen
if isElement(vehs[source]) then destroyElement(vehs[source]) end
end
end)


Strona clienta:
local districtsBus = {
{
-205413628},
{-1987.773437566.000976562528.20802116394},
{-1982.23242187561.487304687528.397748947144},
{-1975.8789062554.3398437528.820150375366},
{-1979.049804687542.416992187530.257034301758},
{-1987.085937544.155273437530.382406234741},
{-1992.88476562542.5351562531.611793518066},
{-1986.772460937539.070312531.022226333618},
{-1983.411132812535.256835937531.097345352173},
{-1978.911132812529.780273437531.77773475647},
{-1976.24414062540.686523437530.465520858765},
{-1967.719726562550.03320312529.339172363281},
{-1963.479492187560.653320312528.409980773926},
{-1963.54687566.148437528.088659286499},
{-1968.973632812567.5273437528.111268997192},
{-1968.01562573.370117187527.749971389771},
{-1980.6289062571.92382812527.959045410156},
{-1992.429687569.545898437528.074096679688},
{-1993.46289062564.06835937528.889764785767},
{-1989.557617187556.41601562529.259981155396},
{-1982.26757812559.733398437528.471450805664},
{-1984.20117187573.577148437527.889549255371},

}

local jobTarget
local jobMarker
local jobVehicle
local maxTarget #districtsBus

function finishJob()
if jobMarker and isElement(jobMarkerthen
destroyElement(jobMarker)
jobMarker nil
end

if jobTarget and isElement(jobTargetthen
destroyElement(jobTarget)
jobTarget nil
jobTarget 0

end

triggerServerEvent("destroyVeh"localPlayer)

end


function busDriver(elmd)
if el ~= localPlayer or not md then return end
if jobTarget maxTarget and getPedOccupiedVehicle(elthen return end
if jobTarget == maxTarget and not getPedOccupiedVehicle(elthen return end

if jobTarget == #districtsBus then
finishJob()
playSoundFrontEnd(5)
outputChatBox("** Rozpocz??e?/a? prac? spedytora, przetransportuj skrzynki do danego celu. ")
else
showMarker()
playSoundFrontEnd(12)
triggerServerEvent("givePlayerMoney"resourceRoot150)

end
end

function showMarker()
if jobMarker and isElement(jobMarkerthen
destroyElement(jobMarker)
jobMarker nil
end

jobTarget jobTarget 1
jobMarker createMarker(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3], "checkpoint"400255)

if districtsBus[jobTarget+1then
ile districtsBus[jobTarget+1]
setMarkerTarget(jobMarkerile[1], ile[2], ile[3])
end

addEventHandler("onClientMarkerHit"jobMarkerbusDriver)
end

addEvent("STARTJobBus"true)
addEventHandler("STARTJobBus"resourceRoot, function(veh)
outputChatBox("** Rozpocz??e?/a? prac? spedytora, przetransportuj skrzynki do danego celu.")
jobVehicle veh
jobTarget 0
showMarker()
end)

addEventHandler("onClientResourceStop"resourceRoot, function()
if jobVehicle and getElementData(localPlayer"gracz_praca"then
setElementData(localPlayer"gracz_praca"false)
end
end)

addEventHandler("onClientVehicleExit"resourceRoot, function(plrseat)
if seat == 0 then
if plr == localPlayer then
finishJob()
outputChatBox("** Zako?czy?e? prac? spedytora.")
end
end
end)


Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-11, 16:01


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

Emm, Testuje...

[ Dodano: 2016-03-11, 16:05 ]
Emm, Jest, dzi?kuje serdecznie wynagradzam piwkami** i respektem! :)

Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Tagi: praca :: nie :: daje :: pieniędzy...
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Praca nie daje pieniędzy... 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