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

Wysłany: 2015-08-07, 15:55


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Witam co jest ?le bo nie tworz? si? markery ;(

Server

createBlip (-2749.2126464844, -282.720489501957.0390625522)

local m1 createMarker(-2749.2126464844, -282.720489501957.0390625"cylinder"2.000255)
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 trakcie przygotowania."el)
        return
    end

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

    local x,y,getElementPosition(el)
    local bus createVehicle(574x,y,z,0.0360.0269.9)

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

    setVehicleHandling(bus,"maxVelocity"50.00)

    warpPedIntoVehicle(elbus)
    removePreviousVehicles(el)
    triggerClientEvent(el"STARTJobBus"resourceRootbus)
    setVehicleHandling(bus,"maxVelocity"50,00) 

    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)


Client

local districtsBus = {
{-2759.78515625, -300.922729492196.8835577964783},
{-2773.8361816406, -308.591247558597.0846495628357},
{-2793.779296875, -327.030120849616.88765001297},
{-2816.8186035156, -343.998809814456.918562412262},
{-2821.4213867188, -376.26101684577.0752058029175},
{-2823.5893554688, -411.743103027347.0917067527771},
{-2822.4833984375, -438.375213623057.0492911338806},
{-2813.8803710938, -469.296112060556.9075212478638},
{-2799.2646484375, -479.850189208987.2319717407227},
{-2780.4416503906, -484.739318847667.0658345222473},
{-2766.7194824219, -467.843322753917.0986380577087},
{-2748.4162597656, -447.961120605477.2059483528137},
{-2725.7619628906, -426.818695068367.3407506942749},
{-2698.5961914063, -405.724151611337.8891768455505},
{-2670.0832519531, -386.274047851569.6316785812378},
{-2640.3544921875, -369.7534790039112.902630805969},
{-2619.3635253906, -363.5652160644515.981020927429},
{-2593.1499023438, -356.4197387695320.162046432495},
{-2565.2365722656, -350.3842163085923.93825340271},
{-2538.2202148438, -347.1373291015626.719783782959},
{-2507.6264648438, -344.4517517089829.533433914185},
{-2473.9079589844, -344.0972595214832.209060668945},
{-2435.1982421875, -344.6730041503935.02466583252},
{-2401.1145019531, -344.958282470737.100784301758},
{-2369.4729003906, -345.4796752929738.684703826904},
{-2332.7465820313, -347.0802612304739.702171325684},
{-2283.7736816406, -349.5078735351639.854637145996},
{-2239.9313964844, -350.8865051269538.217311859131},
{-2200.79296875, -351.3177490234436.684803009033},
{-2119.822265625, -350.831756591835.093048095703},
{-2085.0456542969, -355.492889404335.381050109863},
{-2047.3256835938, -344.0583801269535.335376739502},
{-2027.3559570313, -320.3162231445335.272094726563},
{-2002.6357421875, -274.4011230468835.146259307861},
{-2002.1392822266, -237.6461639404335.783416748047},
{-2002.1201171875, -189.8815460205135.765701293945},
{-2002.4118652344, -145.0670013427735.766960144043},
{-2003.3151855469, -102.1239700317435.719841003418},
{-2014.3458251953, -68.0056228637734.955924987793},
{-2035.2889404297, -67.55811309814535.217990875244},
{-2065.3271484375, -67.27135467529335.225231170654},
{-2090.3310546875, -67.19121551513735.225151062012},
{-2124.7634277344, -67.14456176757835.225467681885},
{-2161.0964355469, -67.22535705566435.226318359375},
{-2194.9211425781, -67.30137634277335.225452423096},
{-2228.2924804688, -67.37604522705135.225448608398},
{-2260.5302734375, -67.44786071777335.225402832031},
{-2291.6936035156, -67.51699066162135.217666625977},
{-2327.6398925781, -67.59633636474635.217533111572},
{-2363.4113769531, -67.67486572265635.231216430664},
{-2398.2707519531, -67.75105285644535.218166351318},
{-2419.10546875, -57.9469451904335.153244018555},
{-2418.796875, -37.20022964477535.21688079834},
{-2418.5908203125, -7.021118640899735.216732025146},
{-2418.615722656329.17665481567435.072303771973},
{-2433.637939453142.24863815307634.720203399658},
{-2452.850585937540.76729583740233.596279144287},
{-2481.335693359440.8662528991728.065719604492},
{-2531.60351562540.64057159423821.937063217163},
{-2590.787597656340.6682319641114.0481724739075},
{-2630.985351562540.7875404357914.2346301078796},
{-2678.751220703140.9357795715334.2389912605286},
{-2708.43554687518.4550266265874.2151455879211},
{-2708.3083496094, -8.2412681579594.2246460914612},
{-2708.279296875, -43.700279235844.2364273071289},
{-2708.2446289063, -87.1692352294924.2297778129578},
{-2708.208984375, -132.129074096684.232958316803},
{-2708.1774902344, -174.31668090824.2675747871399},
{-2728.2336425781, -208.430603027346.6568455696106},
{-2777.251953125, -207.301528930667.0923757553101},
{-2812.0173339844, -232.985794067387.0773029327393}
{-2812.6689453125, -250.94154357917.0817537307739},
{-2815.275390625, -293.758148193367.0845141410828},
{-2817.3041992188, -326.497039794927.1099371910095},
{-2795.4387207031, -332.866577148447.0847282409668},
{-2774.5307617188, -315.643371582037.1167311668396},

}



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("givePlayerMoney"localPlayer51)
    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?.")
    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)


DB3:
Loading Script Failed ulica\bus_c.lua:74: '}' expected (to close'{' at line 2) near '{'

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-07, 16:48


THEGizmo

Modeler/Uczeń Lua






Wiek: 27
Na forum: 4141 dni
Posty: 255
Nick w MP: THEGizmo

Piwa: 3072

Respekt: 200
Respekt: 200Respekt: 200


local districtsBus = {
{-2759.78515625, -300.922729492196.8835577964783},
{-2773.8361816406, -308.591247558597.0846495628357},
{-2793.779296875, -327.030120849616.88765001297},
{-2816.8186035156, -343.998809814456.918562412262},
{-2821.4213867188, -376.26101684577.0752058029175},
{-2823.5893554688, -411.743103027347.0917067527771},
{-2822.4833984375, -438.375213623057.0492911338806},
{-2813.8803710938, -469.296112060556.9075212478638},
{-2799.2646484375, -479.850189208987.2319717407227},
{-2780.4416503906, -484.739318847667.0658345222473},
{-2766.7194824219, -467.843322753917.0986380577087},
{-2748.4162597656, -447.961120605477.2059483528137},
{-2725.7619628906, -426.818695068367.3407506942749},
{-2698.5961914063, -405.724151611337.8891768455505},
{-2670.0832519531, -386.274047851569.6316785812378},
{-2640.3544921875, -369.7534790039112.902630805969},
{-2619.3635253906, -363.5652160644515.981020927429},
{-2593.1499023438, -356.4197387695320.162046432495},
{-2565.2365722656, -350.3842163085923.93825340271},
{-2538.2202148438, -347.1373291015626.719783782959},
{-2507.6264648438, -344.4517517089829.533433914185},
{-2473.9079589844, -344.0972595214832.209060668945},
{-2435.1982421875, -344.6730041503935.02466583252},
{-2401.1145019531, -344.958282470737.100784301758},
{-2369.4729003906, -345.4796752929738.684703826904},
{-2332.7465820313, -347.0802612304739.702171325684},
{-2283.7736816406, -349.5078735351639.854637145996},
{-2239.9313964844, -350.8865051269538.217311859131},
{-2200.79296875, -351.3177490234436.684803009033},
{-2119.822265625, -350.831756591835.093048095703},
{-2085.0456542969, -355.492889404335.381050109863},
{-2047.3256835938, -344.0583801269535.335376739502},
{-2027.3559570313, -320.3162231445335.272094726563},
{-2002.6357421875, -274.4011230468835.146259307861},
{-2002.1392822266, -237.6461639404335.783416748047},
{-2002.1201171875, -189.8815460205135.765701293945},
{-2002.4118652344, -145.0670013427735.766960144043},
{-2003.3151855469, -102.1239700317435.719841003418},
{-2014.3458251953, -68.0056228637734.955924987793},
{-2035.2889404297, -67.55811309814535.217990875244},
{-2065.3271484375, -67.27135467529335.225231170654},
{-2090.3310546875, -67.19121551513735.225151062012},
{-2124.7634277344, -67.14456176757835.225467681885},
{-2161.0964355469, -67.22535705566435.226318359375},
{-2194.9211425781, -67.30137634277335.225452423096},
{-2228.2924804688, -67.37604522705135.225448608398},
{-2260.5302734375, -67.44786071777335.225402832031},
{-2291.6936035156, -67.51699066162135.217666625977},
{-2327.6398925781, -67.59633636474635.217533111572},
{-2363.4113769531, -67.67486572265635.231216430664},
{-2398.2707519531, -67.75105285644535.218166351318},
{-2419.10546875, -57.9469451904335.153244018555},
{-2418.796875, -37.20022964477535.21688079834},
{-2418.5908203125, -7.021118640899735.216732025146},
{-2418.615722656329.17665481567435.072303771973},
{-2433.637939453142.24863815307634.720203399658},
{-2452.850585937540.76729583740233.596279144287},
{-2481.335693359440.8662528991728.065719604492},
{-2531.60351562540.64057159423821.937063217163},
{-2590.787597656340.6682319641114.0481724739075},
{-2630.985351562540.7875404357914.2346301078796},
{-2678.751220703140.9357795715334.2389912605286},
{-2708.43554687518.4550266265874.2151455879211},
{-2708.3083496094, -8.2412681579594.2246460914612},
{-2708.279296875, -43.700279235844.2364273071289},
{-2708.2446289063, -87.1692352294924.2297778129578},
{-2708.208984375, -132.129074096684.232958316803},
{-2708.1774902344, -174.31668090824.2675747871399},
{-2728.2336425781, -208.430603027346.6568455696106},
{-2777.251953125, -207.301528930667.0923757553101},
{-2812.0173339844, -232.985794067387.0773029327393},
{-2812.6689453125, -250.94154357917.0817537307739},
{-2815.275390625, -293.758148193367.0845141410828},
{-2817.3041992188, -326.497039794927.1099371910095},
{-2795.4387207031, -332.866577148447.0847282409668},
{-2774.5307617188, -315.643371582037.1167311668396},

}



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("givePlayerMoney"localPlayer51)
    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?.")
    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)


Je?li pomog?em daj :piwo:

Podpis
Modeler Corporation Sp. Z.O.O

Postaw piwo autorowi tego posta
 

 
Tagi: praca :: sweeper
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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