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

Wysłany: 2015-08-25, 18:13


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157


--[[
Praca busa

@copyright 2013-2014 Split <split@go-life.pl>
@author Split <split@go-life.pl>
@version 1.0 beta
@changelog:
* Poprawiono prac?.

Nie masz prawa u?ywac tego kodu bez mojej zgody.
Napisz do mnie bymo?e sizgodzna u?ycie kodu.
]]--
local districtsBus = {
 
 {365.10379028322535.187011718828.978340148926},
 {332.316589355472493.29687541.081680297852},
 {301.780731201172427.969482421960.128322601318},
 {272.9863281252365.113769531378.775672912598},
 {240.826705932622299.049560546988.779518127441},
 {195.921691894532198.2749023438106.62964630127},
 {148.117416381842079.39453125121.19399261475},
 {71.5657882690431878.9143066406137.08000183105},
 {23.0387287139891743.6721191406157.64511108398},
 {-8.1232156753541651.3896484375158.23648071289},
 {-96.9897689819341383.0947265625145.01481628418},
 {-135.192596435551258.9887695313137.48251342773},
 {-182.586761474611098.1326904297124.80664825439},
 {-182.58755493164990.39410400391126.6547088623},
 {-107.2110748291931.13787841797137.63739013672},
 {-3.0844504833221971.85510253906148.95761108398},
 {57.4743843078611075.6530761719142.88092041016},
 {90.0873260498051299.9056396484109.51367950439},
 {113.492790222171452.0389404297111.97846984863},
 {195.570739746091876.6184082031114.44400787354},
 {253.781494140632128.2270507813103.76750946045},
 {309.428955078132343.784423828192.612403869629},
 {340.171356201172456.670898437560.742736816406},
 {360.674682617192518.204101562533.290943145752},
 {364.282531738282540.844970703120.09356880188},
    
    }

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("* Zako?czy?e?/a? prac?.")
    else
        showMarker()
        playSoundFrontEnd(12)
        triggerServerEvent("giveGPoint"root) 
        triggerServerEvent("givePlayerMoney"el10 ,1)
    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], "ring"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?.")
    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?")
        end
    end
end)


jak to przerobi? ?e jak ju? wesz?e? w marker i ci si? zrespi?o auto to ci losowo wybiera punkt /

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-25, 18:28


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

1. Wszed?e?*


2. przyk?ad :

local pkt={
    {0,0,1},
    {0,0,2}
}


rnd=math.random(1,#pkt)
local x,y,z=pkt[rnd][1],pkt[rnd][2],pkt[rnd][3]


Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-25, 18:42


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

local pkt = {
 
 {365.10379028322535.187011718828.978340148926},
 {332.316589355472493.29687541.081680297852},
 {301.780731201172427.969482421960.128322601318},
 {272.9863281252365.113769531378.775672912598},
 {240.826705932622299.049560546988.779518127441},
 {195.921691894532198.2749023438106.62964630127},
 {148.117416381842079.39453125121.19399261475},
 {71.5657882690431878.9143066406137.08000183105},
 {23.0387287139891743.6721191406157.64511108398},
 {-8.1232156753541651.3896484375158.23648071289},
 {-96.9897689819341383.0947265625145.01481628418},
 {-135.192596435551258.9887695313137.48251342773},
 {-182.586761474611098.1326904297124.80664825439},
 {-182.58755493164990.39410400391126.6547088623},
 {-107.2110748291931.13787841797137.63739013672},
 {-3.0844504833221971.85510253906148.95761108398},
 {57.4743843078611075.6530761719142.88092041016},
 {90.0873260498051299.9056396484109.51367950439},
 {113.492790222171452.0389404297111.97846984863},
 {195.570739746091876.6184082031114.44400787354},
 {253.781494140632128.2270507813103.76750946045},
 {309.428955078132343.784423828192.612403869629},
 {340.171356201172456.670898437560.742736816406},
 {360.674682617192518.204101562533.290943145752},
 {364.282531738282540.844970703120.09356880188},
    
    }

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("* Zako?czy?e?/a? prac?.")
    else
        showMarker()
        playSoundFrontEnd(12)
        triggerServerEvent("giveGPoint"root) 
        triggerServerEvent("givePlayerMoney"el10 ,1)
    end
end

function showMarker()
    if jobMarker and isElement(jobMarkerthen
        destroyElement(jobMarker)
        jobMarker nil
    end
    
    rnd=math.random(1,#pkt)
     local x,y,z=pkt[rnd][1],pkt[rnd][2],pkt[rnd][3]
    
    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?.")
    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?")
        end
    end
end)
?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-25, 20:42


Dexnes_

Tiger






Wiek: 26
Na forum: 4401 dni
Posty: 620
Nick w MP: Dexnes

Piwa: 1394

Respekt: 390
Respekt: 390Respekt: 390Respekt: 390Respekt: 390

Sprawdz czy dzia?a

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-25, 20:42


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Nie dzia?a ;(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-25, 20:48


Dexnes_

Tiger






Wiek: 26
Na forum: 4401 dni
Posty: 620
Nick w MP: Dexnes

Piwa: 1394

Respekt: 390
Respekt: 390Respekt: 390Respekt: 390Respekt: 390

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-25, 20:51


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

nie mo?esz ty pom?c ?

Postaw piwo autorowi tego posta
 

 
Tagi: praca :: dorywcza
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 Dorywcza 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