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

Wysłany: 2015-05-28, 17:58


OskarYT

Mapper MTA






Wiek: 26
Na forum: 4386 dni
Posty: 267
Nick w MP: Kaczorek2306

Piwa: 1230

Respekt: 85,3

local districtsPizza = { ---- kordy dostarczania graczy
    {-291.1318359375, 1163.7275390625, 19.696998596191},
    {-335.0615234375, 1171.697265625, 19.901586532593},
    {-320.7666015625, 1163.1123046875, 20.2421875},
    {-364.9287109375, 1165.5341796875, 19.7421875},
    {-367.416015625, 1145.8359375, 20.235286712646},
    {-359.54296875, 1129.7119140625, 19.679533004761},
    {-369.2392578125, 1119.2783203125, 20.230415344238},
    {-361.92578125, 1104.31640625, 19.749286651611},
    {-331.36328125, 1115.37890625, 20.2421875},
    {-322.1962890625, 1130.2138671875, 19.83712387085},
    {-289.51171875, 1122.337890625, 20.238082885742},
    {-304.302734375, 1114.52734375, 19.7421875},
    {-260.83984375, 1165.4375, 20.2421875},
    {-251.5693359375, 1179.39453125, 19.93016242981},
    {-259.517578125, 1156.6357421875, 19.7421875},
    {-251.677734375, 1142.8095703125, 20.243007659912},
    {-260.6396484375, 1130.6669921875, 19.759662628174},
    {-253.7919921875, 1115.990234375, 20.232286453247},
    {-248.8818359375, 1083.751953125, 19.902923583984},
    {-262.7373046875, 1076.2373046875, 20.249408721924},
    {-252.0732421875, 1054.12109375, 19.956705093384},
    {-260.552734375, 1040.31640625, 20.2421875},
    {-282.9853515625, 995.6962890625, 20.2421875},
    {-267.791015625, 1004.333984375, 19.679946899414},
    {-256.2158203125, 994.55859375, 20.239133834839},
    {-242.8115234375, 1002.1748046875, 19.7421875},
}
local jobBlip
local jobTarget
local jobMarker
local jobVehicle
local maxTarget = #districtsPizza

function finishJob()
    if jobMarker and isElement(jobMarker) then
        destroyElement(jobMarker)
        jobMarker = nil
    end
    
    if jobTarget and isElement(jobTarget) then
        destroyElement(jobTarget)
        jobTarget = nil
        jobTarget = 0
        
    end
        if jobBlip and isElement(jobBlip) then
        destroyElement(jobBlip)
        jobBlip = nil
        end

triggerServerEvent("destroyVeh", localPlayer)

end


function busDriver(el, md)
    if el ~= localPlayer or not md then return end
    if jobTarget > maxTarget and getPedOccupiedVehicle(el) then return end
    if jobTarget == maxTarget and not getPedOccupiedVehicle(el) then return end
    
    if jobTarget == #districtsPizza then
        finishJob()
        playSoundFrontEnd(5)
        outputChatBox("[#0033ffPraca#FFFFFF]#ffff99*Zako?czy?e?/a? prac?.",255,255,255, true)
    else
        showMarker()
        playSoundFrontEnd(12)
        triggerServerEvent("givePlayerMoney", localPlayer, 15, 1)
    end
end

function showMarker()
    if jobMarker and isElement(jobMarker) then
        destroyElement(jobMarker)
        jobMarker = nil
    end
  if jobBlip and isElement(jobBlip) then
        destroyElement(jobBlip)
        jobBlip = nil
    end
  
    
    jobTarget = jobTarget + 1
    jobMarker = createMarker(districtsPizza[jobTarget][1], districtsPizza[jobTarget][2], districtsPizza[jobTarget][3], "checkpoint", 4, 0, 0, 255)
    jobBlip = createBlipAttachedTo(jobMarker, 41)
    if districtsPizza[jobTarget+1] then
        ile = districtsPizza[jobTarget+1]
        setMarkerTarget(jobMarker, ile[1], ile[2], ile[3])
    end
    
    addEventHandler("onClientMarkerHit", jobMarker, busDriver)
    addEventHandler("onClientMarkerHit", jobMarker, frezeBus)
end

function frezeBus(el)
 local p=getPedOccupiedVehicle(el)
       outputChatBox("[#0033ffPraca#FFFFFF]#ffff99*Dowioz?e? Pizze.",255,255,255, true)
       setElementFrozen(p, true)
       setTimer(setElementFrozen, 10000, 1, p, false)
       end
       

addEvent("STARTJobBus", true)
addEventHandler("STARTJobBus", resourceRoot, function(veh)
    outputChatBox("[#0033ffPraca#FFFFFF]#ffff99*Rozpocz??e?/a? prac?.",255,255,255, true)
    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(plr, seat)
    if seat == 0 then
        if plr == localPlayer then
            finishJob()
            outputChatBox("[#0033ffPraca#FFFFFF]#ffff99*Zako?czy?e? prac?",255,255,255, true)
            end
        end
   end)


Witam mam skrypt na prace pizza boy
ale jak mam markery to lec? po kolei a ja bym chcia? aby bra?o losowo markery
przeistoczy? by kto? ten kod tak aby by?y brane pozycje RANDOMOWO ??
Stawiam za to :piwo: lub nawet R*

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-28, 18:52


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Musisz dodac random.math :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-28, 18:57


OskarYT

Mapper MTA






Wiek: 26
Na forum: 4386 dni
Posty: 267
Nick w MP: Kaczorek2306

Piwa: 1230

Respekt: 85,3

"AstroStudio" napisał/a:

Musisz dodac random.math :)


to wiem ale nwm jak i gdzie

 local nowmarker;
        repeat 
        nowmarker = math.random(1,#jobPositions)
        until lastMarkerID ~= nowmarker
            lastMarkerID = nowmarker
local x, y, z = unpack(jobPositions[nowmarker])
actualMarker = createMarker(x,y,z-1,"checkpoint",3,255,0,0,50)


Co? takiego ??
jak narazie jestem zielony w LUA
wi?c prosz? o gotowca :(

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-28, 19:07


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

mozesz sobie podgladnac ten kod : jest on z pracy pizzy od splita :)
Kod:

local praca = createMarker(-37.422451019287, 1186.9564208984, 19.359375, "cylinder", 4.0, 255, 120, 0)

local miejscaelektryk = {
{19.359375,1229.2736816406,22.503162384033},
{76.78881072998,1161.9624023438,18.6640625},
{0.90696263313293,1076.0782470703,20.939865112305},
{-204.91404724121,1062.3820800781,19.7421875},
}

addEventHandler("onClientMarkerHit", praca, function(el, md)
if not md or getElementType(el) ~= "player" then return end
if el ~= localPlayer then return end
outputChatBox("* Zarobki pracy: 4 ZL? Za 1 Pizze.")
outputChatBox("* Aby rozpoczac prace kliknij 'E'")
end)

bindKey("e", "down", function()
if not isElementWithinMarker(localPlayer, praca) then return end
if not getElementData(localPlayer, "gracz_praca") then
local losuj = math.random(2, #miejscaelektryk)
setElementData(localPlayer, "gracz_praca", true)
outputChatBox("* Dostarcz pizze w wyznaczony cel")

local cel = createMarker(miejscaelektryk[losuj][1], miejscaelektryk[losuj][2], miejscaelektryk[losuj][3],miejscaelektryk[losuj][4]-1.0, "cylinder", 4.0, 255, 0, 0)
local blip = createBlipAttachedTo(cel, 41)

addEventHandler("onClientMarkerHit", cel, function(el, md)
if not md or getElementType(el) ~= "player" then return end
if el ~= localPlayer then return end

if getPedOccupiedVehicle(el) then
outputChatBox("* Wyjdz z pojazdu aby dac pizze")
return
end

destroyElement(cel)
destroyElement(blip)
setElementFrozen(el, true)
outputChatBox("* Pukasz Do Drzwi i dajesz Pizze Poczekaj (2 sekundy)")
setTimer(function()
setElementFrozen(el, false)
outputChatBox("* Oddales pizze dla klienta!")
setElementData(el, "gracz_praca", false)
triggerClientEvent("givePlayerMoney", el, 4 ,0)
end, 2000, 1)
end)
else
outputChatBox("* Posiadasz juz aktywna praca.")
end
end)



Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-29, 19:12


Fanciak

BOT






Wiek: 26
Na forum: 4587 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

Zamie? sobie to:


addEvent("STARTJobBus", true)
addEventHandler("STARTJobBus", resourceRoot, function(veh)
    outputChatBox("[#0033ffPraca#FFFFFF]#ffff99*Rozpocz??e?/a? prac?.",255,255,255, true)
    jobVehicle = veh
    jobTarget = 0
    math.random(26, #districtsPizza) 
end)



Zawsze si? to robi, jak zaczyna si? prac?. Nie s?dzisz?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-30, 11:08


OskarYT

Mapper MTA






Wiek: 26
Na forum: 4386 dni
Posty: 267
Nick w MP: Kaczorek2306

Piwa: 1230

Respekt: 85,3

local districtsPizza = { ---- kordy dostarczania graczy
    {-291.1318359375, 1163.7275390625, 19.696998596191},
    {-335.0615234375, 1171.697265625, 19.901586532593},
    {-320.7666015625, 1163.1123046875, 20.2421875},
    {-364.9287109375, 1165.5341796875, 19.7421875},
    {-367.416015625, 1145.8359375, 20.235286712646},
    {-359.54296875, 1129.7119140625, 19.679533004761},
    {-369.2392578125, 1119.2783203125, 20.230415344238},
    {-361.92578125, 1104.31640625, 19.749286651611},
    {-331.36328125, 1115.37890625, 20.2421875},
    {-322.1962890625, 1130.2138671875, 19.83712387085},
    {-289.51171875, 1122.337890625, 20.238082885742},
    {-304.302734375, 1114.52734375, 19.7421875},
    {-260.83984375, 1165.4375, 20.2421875},
    {-251.5693359375, 1179.39453125, 19.93016242981},
    {-259.517578125, 1156.6357421875, 19.7421875},
    {-251.677734375, 1142.8095703125, 20.243007659912},
    {-260.6396484375, 1130.6669921875, 19.759662628174},
    {-253.7919921875, 1115.990234375, 20.232286453247},
    {-248.8818359375, 1083.751953125, 19.902923583984},
    {-262.7373046875, 1076.2373046875, 20.249408721924},
    {-252.0732421875, 1054.12109375, 19.956705093384},
    {-260.552734375, 1040.31640625, 20.2421875},
    {-282.9853515625, 995.6962890625, 20.2421875},
    {-267.791015625, 1004.333984375, 19.679946899414},
    {-256.2158203125, 994.55859375, 20.239133834839},
    {-242.8115234375, 1002.1748046875, 19.7421875},
}
local jobBlip
local jobTarget
local jobMarker
local jobVehicle
local maxTarget = #districtsPizza

function finishJob()
    if jobMarker and isElement(jobMarker) then
        destroyElement(jobMarker)
        jobMarker = nil
    end
    
    if jobTarget and isElement(jobTarget) then
        destroyElement(jobTarget)
        jobTarget = nil
        jobTarget = 0
        
    end
        if jobBlip and isElement(jobBlip) then
        destroyElement(jobBlip)
        jobBlip = nil
        end

triggerServerEvent("destroyVeh", localPlayer)

end


function busDriver(el, md)
    if el ~= localPlayer or not md then return end
    if jobTarget > maxTarget and getPedOccupiedVehicle(el) then return end
    if jobTarget == maxTarget and not getPedOccupiedVehicle(el) then return end
    
    if jobTarget == #districtsPizza then
        finishJob()
        playSoundFrontEnd(5)
        outputChatBox("[#0033ffPraca#FFFFFF]#ffff99*Zako?czy?e?/a? prac?.",255,255,255, true)
    else
        showMarker()
        playSoundFrontEnd(12)
        triggerServerEvent("givePlayerMoney", localPlayer, 3, 1)
    end
end

function showMarker()
    if jobMarker and isElement(jobMarker) then
        destroyElement(jobMarker)
        jobMarker = nil
    end
  if jobBlip and isElement(jobBlip) then
        destroyElement(jobBlip)
        jobBlip = nil
    end
  
    
    jobTarget = jobTarget + 1
    jobMarker = createMarker(districtsPizza[jobTarget][1], districtsPizza[jobTarget][2], districtsPizza[jobTarget][3], "checkpoint", 4, 0, 0, 255)
    jobBlip = createBlipAttachedTo(jobMarker, 41)
    if districtsPizza[jobTarget+1] then
        ile = districtsPizza[jobTarget+1]
        setMarkerTarget(jobMarker, ile[1], ile[2], ile[3])
    end
    
    addEventHandler("onClientMarkerHit", jobMarker, busDriver)
    addEventHandler("onClientMarkerHit", jobMarker, frezeBus)
end

function frezeBus(el)
 local p=getPedOccupiedVehicle(el)
       outputChatBox("[#0033ffPraca#FFFFFF]#ffff99*Dowioz?e? Pizze.",255,255,255, true)
       setElementFrozen(p, true)
       setTimer(setElementFrozen, 10000, 1, p, false)
       end
       

addEvent("STARTJobBus", true)
addEventHandler("STARTJobBus", resourceRoot, function(veh)
    outputChatBox("[#0033ffPraca#FFFFFF]#ffff99*Rozpocz??e?/a? prac?.",255,255,255, true)
    jobVehicle = veh
    jobTarget = 0
    math.random(26, #districtsPizza) 
end)

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

addEventHandler("onClientVehicleExit", resourceRoot, function(plr, seat)
    if seat == 0 then
        if plr == localPlayer then
            finishJob()
            outputChatBox("[#0033ffPraca#FFFFFF]#ffff99*Zako?czy?e? prac?",255,255,255, true)
            end
        end
   end)


Zmieni?em tak jak powiedzia?e? zobacz sobie powy?ej ale teraz wog?le nie wida? blipa na mapie i markery niew powstaj? tam gdzie si? dowozi pizze !!
prosz? ciebie aby? mi pom?g? teraz to naprawi? :(

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-30, 11:11


Fanciak

BOT






Wiek: 26
Na forum: 4587 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

Wiesz, z?otej kuli nie mam. Podaj b??dy w /debugscript 3.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-30, 11:13


OskarYT

Mapper MTA






Wiek: 26
Na forum: 4386 dni
Posty: 267
Nick w MP: Kaczorek2306

Piwa: 1230

Respekt: 85,3

"Fanciak" napisał/a:

Wiesz, z?otej kuli nie mam. Podaj b??dy w /debugscript 3.


0% bug?w ale i tak nie pokazuje teraz blip?w na mapie !! :(

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-30, 11:14


Fanciak

BOT






Wiek: 26
Na forum: 4587 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

Mog? prosi? tu lub na PW reszt? kodu (reszt? plik?w .lua)? Wgram sobie to na serwer i spr?buje naprawi?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-30, 11:16


OskarYT

Mapper MTA






Wiek: 26
Na forum: 4386 dni
Posty: 267
Nick w MP: Kaczorek2306

Piwa: 1230

Respekt: 85,3

"Fanciak" napisał/a:

Mog? prosi? tu lub na PW reszt? kodu (reszt? plik?w .lua)? Wgram sobie to na serwer i spr?buje naprawi?.


wy?l? ci na PM

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-30, 11:48


Fanciak

BOT






Wiek: 26
Na forum: 4587 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

Ju? dzia?a :)


local districtsPizza = {} ---- kordy dostarczania graczy  
    districtsPizza[1]= {-320.7666015625, 1163.1123046875, 20.2421875}
  districtsPizza[2]= {-364.9287109375, 1165.5341796875, 19.7421875}
    districtsPizza[3]= {-367.416015625, 1145.8359375, 20.235286712646}
    districtsPizza[4]= {-359.54296875, 1129.7119140625, 19.679533004761}
    districtsPizza[5]= {-369.2392578125, 1119.2783203125, 20.230415344238}
    districtsPizza[6]= {-361.92578125, 1104.31640625, 19.749286651611}
    districtsPizza[7]= {-331.36328125, 1115.37890625, 20.2421875}
    districtsPizza[8]= {-322.1962890625, 1130.2138671875, 19.83712387085}
    districtsPizza[9]= {-289.51171875, 1122.337890625, 20.238082885742}
    districtsPizza[10]= {-304.302734375, 1114.52734375, 19.7421875}
    districtsPizza[11]= {-260.83984375, 1165.4375, 20.2421875}
    districtsPizza[12]= {-251.5693359375, 1179.39453125, 19.93016242981}
    districtsPizza[13]= {-259.517578125, 1156.6357421875, 19.7421875}
    districtsPizza[14]= {-251.677734375, 1142.8095703125, 20.243007659912}
    districtsPizza[15]= {-260.6396484375, 1130.6669921875, 19.759662628174}
    districtsPizza[16]= {-253.7919921875, 1115.990234375, 20.232286453247}
    districtsPizza[17]= {-248.8818359375, 1083.751953125, 19.902923583984}
    districtsPizza[18]= {-262.7373046875, 1076.2373046875, 20.249408721924}
    districtsPizza[19]= {-252.0732421875, 1054.12109375, 19.956705093384}
    districtsPizza[20]= {-260.552734375, 1040.31640625, 20.2421875}
    districtsPizza[21]= {-282.9853515625, 995.6962890625, 20.2421875}
    districtsPizza[22]= {-267.791015625, 1004.333984375, 19.679946899414}
    districtsPizza[23]= {-256.2158203125, 994.55859375, 20.239133834839}
    districtsPizza[24]= {-242.8115234375, 1002.1748046875, 19.7421875}

local jobBlip
local jobTarget
local jobMarker
local jobVehicle
local maxTarget = math.random(1, 24)

function finishJob()
    if jobMarker and isElement(jobMarker) then
        destroyElement(jobMarker)
        jobMarker = nil
    end
    
    if jobTarget and isElement(jobTarget) then
        destroyElement(jobTarget)
        jobTarget = nil
        jobTarget = 0
        
    end
        if jobBlip and isElement(jobBlip) then
        destroyElement(jobBlip)
        jobBlip = nil
        end

triggerServerEvent("destroyVeh", localPlayer)

end


function busDriver(el, md)
    if el ~= localPlayer or not md then return end
    if jobTarget > maxTarget and getPedOccupiedVehicle(el) then return end
    if jobTarget == maxTarget and not getPedOccupiedVehicle(el) then return end
    
    if jobTarget == #districtsPizza then
        finishJob()
        playSoundFrontEnd(5)
        outputChatBox("[#0033ffPraca#FFFFFF]#ffff99*Zako?czy?e?/a? prac?.",255,255,255, true)
    else
        showMarker(unpack(districtsPizza[maxTarget]))
        playSoundFrontEnd(12)
        triggerServerEvent("givePlayerMoney", localPlayer, 15, 1)
    end
end

function showMarker()
    if jobMarker and isElement(jobMarker) then
        destroyElement(jobMarker)
        jobMarker = nil
    end
  if jobBlip and isElement(jobBlip) then
        destroyElement(jobBlip)
        jobBlip = nil
    end
  
    
    jobTarget = jobTarget + 1
    jobMarker = createMarker(districtsPizza[jobTarget][1], districtsPizza[jobTarget][2], districtsPizza[jobTarget][3], "checkpoint", 4, 0, 0, 255)
    jobBlip = createBlipAttachedTo(jobMarker, 41)
    if districtsPizza[jobTarget+1] then
        ile = districtsPizza[jobTarget+1]
        setMarkerTarget(jobMarker, ile[1], ile[2], ile[3])
    end
    
    addEventHandler("onClientMarkerHit", jobMarker, busDriver)
    addEventHandler("onClientMarkerHit", jobMarker, frezeBus)
end

function frezeBus(el)
 local p=getPedOccupiedVehicle(el)
       outputChatBox("[#0033ffPraca#FFFFFF]#ffff99*Dowioz?e? Pizze.",255,255,255, true)
       setElementFrozen(p, true)
       setTimer(setElementFrozen, 10000, 1, p, false)
       end
       

addEvent("STARTJobBus", true)
addEventHandler("STARTJobBus", resourceRoot, function(veh)
    outputChatBox("[#0033ffPraca#FFFFFF]#ffff99*Rozpocz??e?/a? prac?.",255,255,255, true)
    jobVehicle = veh
    jobTarget = 0
    showMarker(unpack(districtsPizza[maxTarget]))
    end)

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

addEventHandler("onClientVehicleExit", resourceRoot, function(plr, seat)
    if seat == 0 then
        if plr == localPlayer then
            finishJob()
            outputChatBox("[#0033ffPraca#FFFFFF]#ffff99*Zako?czy?e? prac?",255,255,255, true)
            end
        end
   end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-30, 12:54


OskarYT

Mapper MTA






Wiek: 26
Na forum: 4386 dni
Posty: 267
Nick w MP: Kaczorek2306

Piwa: 1230

Respekt: 85,3

Fanciak, to nie jest random tylko zawsze jak zaczne prace od nowa to s? w tych samych miejscach markery nie zmienia si? !!

W debugscript 3 0% bug?w !!

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-30, 21:19


Loop

Inspektor






Wiek: 28
Na forum: 4430 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

Trzymaj


local districtsPizza = { ---- kordy dostarczania graczy
    {-291.1318359375, 1163.7275390625, 19.696998596191},
    {-335.0615234375, 1171.697265625, 19.901586532593},
    {-320.7666015625, 1163.1123046875, 20.2421875},
    {-364.9287109375, 1165.5341796875, 19.7421875},
    {-367.416015625, 1145.8359375, 20.235286712646},
    {-359.54296875, 1129.7119140625, 19.679533004761},
    {-369.2392578125, 1119.2783203125, 20.230415344238},
    {-361.92578125, 1104.31640625, 19.749286651611},
    {-331.36328125, 1115.37890625, 20.2421875},
    {-322.1962890625, 1130.2138671875, 19.83712387085},
    {-289.51171875, 1122.337890625, 20.238082885742},
    {-304.302734375, 1114.52734375, 19.7421875},
    {-260.83984375, 1165.4375, 20.2421875},
    {-251.5693359375, 1179.39453125, 19.93016242981},
    {-259.517578125, 1156.6357421875, 19.7421875},
    {-251.677734375, 1142.8095703125, 20.243007659912},
    {-260.6396484375, 1130.6669921875, 19.759662628174},
    {-253.7919921875, 1115.990234375, 20.232286453247},
    {-248.8818359375, 1083.751953125, 19.902923583984},
    {-262.7373046875, 1076.2373046875, 20.249408721924},
    {-252.0732421875, 1054.12109375, 19.956705093384},
    {-260.552734375, 1040.31640625, 20.2421875},
    {-282.9853515625, 995.6962890625, 20.2421875},
    {-267.791015625, 1004.333984375, 19.679946899414},
    {-256.2158203125, 994.55859375, 20.239133834839},
    {-242.8115234375, 1002.1748046875, 19.7421875},
}
local jobBlip
local jobMarker
local jobVehicle
local maxTarget = #districtsPizza

function finishJob()
    if jobMarker and isElement(jobMarker) then
        destroyElement(jobMarker)
        jobMarker = nil
    end
    
        if jobBlip and isElement(jobBlip) then
        destroyElement(jobBlip)
        jobBlip = nil
        end

triggerServerEvent("destroyVeh", localPlayer)

end


function busDriver(el, md)
    if el ~= localPlayer or not md then return end
if not getPedOccupiedVehicle(el) then return end
        showMarker()
        playSoundFrontEnd(12)
        triggerServerEvent("givePlayerMoney", localPlayer, 15, 1)
    end

function showMarker()
    if jobMarker and isElement(jobMarker) then
        destroyElement(jobMarker)
        jobMarker = nil
    end
  if jobBlip and isElement(jobBlip) then
        destroyElement(jobBlip)
        jobBlip = nil
    end
  
    los = math.random(1, #districtsPizza)
    jobMarker = createMarker(districtsPizza[los][1], districtsPizza[los][2], districtsPizza[los][3], "checkpoint", 3.2, 0, 150, 255,100,52)
    jobBlip = createBlipAttachedTo(jobMarker, 41)

    
    addEventHandler("onClientMarkerHit", jobMarker, busDriver)
    addEventHandler("onClientMarkerHit", jobMarker, frezeBus)
end

function frezeBus(el)
 local p=getPedOccupiedVehicle(el)
       outputChatBox("[#0033ffPraca#FFFFFF]#ffff99*Dowioz?e? Pizze.",255,255,255, true)
       setElementFrozen(p, true)
       setTimer(setElementFrozen, 10000, 1, p, false)
       end
       

addEvent("STARTJobBus", true)
addEventHandler("STARTJobBus", resourceRoot, function(veh)
    outputChatBox("[#0033ffPraca#FFFFFF]#ffff99*Rozpocz??e?/a? prac?.",255,255,255, true)
    jobVehicle = veh
    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(plr, seat)
    if seat == 0 then
        if plr == localPlayer then
            finishJob()
            outputChatBox("[#0033ffPraca#FFFFFF]#ffff99*Zako?czy?e? prac?",255,255,255, true)
            end
        end
   end)



Postaw piwo autorowi tego posta
 

 
Tagi: pizzaboy :: praca :: randomowe :: pozycje
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » PizzaBoy praca randomowe pozycje 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