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

Wysłany: 2015-06-05, 13:09


P.Wiśnia

Programista LUA






Wiek: 25
Na forum: 4186 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 378

Respekt: 100
Respekt: 100

Dlaczego Skrypt Nie Dzi?a Jestem Pocz?tkuj?czym


local bsMarker = createMarker(-1753.84,961.92,24,"cylinder",1.5,252,0,255,50)
createBlipAttachedTo(bsMarker,59)

local districtsBus = {

    {45.83,1201.23,18.81},
    {-66.73,1201.60,19.59},
    {-68.33,1148.97,19.59},
    {24.26,1144.16,19.59},
    {26.12,1102.61,19.59},
    {-65.06,1101.15,19.59},
    {-185.69,1100.93,19.60},
    {-188.17,1193.49,19.55},
    {-115.97,1196.37,19.59},
    {-117.24,1251.94,17.41},
    {-73.71,1256.68,12.09},
    {64.41,1220.31,18.83},
   
}

local jobTarget
local jobMarker
local jobVehicle
local maxTarget = #districtsBus

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
    
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 == #districtsBus then
        finishJob()
        playSoundFrontEnd(5)
        outputChatBox("* Zako?czy?e?/a? prac?.")
    else
        showMarker()
        playSoundFrontEnd(12)
        triggerServerEvent("givePlayerMoney", localPlayer, 3, 0)
    end
end

function showMarker()
    if jobMarker and isElement(jobMarker) then
        destroyElement(jobMarker)
        jobMarker = nil
    end
    
    jobTarget = jobTarget + 1
    jobMarker = createMarker(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3], "checkpoint", 4, 0, 0, 255)
    
    if districtsBus[jobTarget+1] then
        ile = districtsBus[jobTarget+1]
        setMarkerTarget(jobMarker, ile[1], ile[2], ile[3])
    end
    
    addEventHandler("onClientMarkerHit", jobMarker, busDriver)
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(plr, seat)
    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-06-05, 13:20


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4568 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

Masz jakie? db3 i co dok?adnie nie dzia?a, opisz. ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-05, 13:22


P.Wiśnia

Programista LUA






Wiek: 25
Na forum: 4186 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 378

Respekt: 100
Respekt: 100

Nie Pojawia Sie maker i nie mozna wziasc pracy

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-05, 13:23


Loop

Inspektor






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

Piwa: 201

Respekt: 130
Respekt: 130

No bo masz tylko strone clienta tej pracy.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-05, 13:37


P.Wiśnia

Programista LUA






Wiek: 25
Na forum: 4186 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 378

Respekt: 100
Respekt: 100

Aha A jak Tamto cos innego zrobic

[ Dodano: 2015-06-05, 13:45 ]
Pomoze Kto?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-05, 13:53


Fanciak

BOT






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

Piwa: 1572

Respekt: 500
Respekt: 500

Aidis, tworzysz plik s_praca.lua i dopisujesz do mety ta nazw? oraz dajesz stron? server. Tworzysz co? podobnego do tego kodu co teraz da?e?, popatrz na inne prace po stronie servera i stworzysz :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-05, 13:58


P.Wiśnia

Programista LUA






Wiek: 25
Na forum: 4186 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 378

Respekt: 100
Respekt: 100

I Nic maker Jest Ale Nie Dzi?a

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-05, 14:00


piotr172







Wiek: 27
Na forum: 4558 dni
Posty: 130

Piwa: 2329

Respekt: 105,3
Respekt: 105,3

Trzeba usun?? przecinek na samym ko?cu. O takie co?:


local districtsBus = {

    {45.83,1201.23,18.81},
    {-66.73,1201.60,19.59},
    {-68.33,1148.97,19.59},
    {24.26,1144.16,19.59},
    {26.12,1102.61,19.59},
    {-65.06,1101.15,19.59},
    {-185.69,1100.93,19.60},
    {-188.17,1193.49,19.55},
    {-115.97,1196.37,19.59},
    {-117.24,1251.94,17.41},
    {-73.71,1256.68,12.09},
    {64.41,1220.31,18.83}
   
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-05, 14:03


Loop

Inspektor






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

Piwa: 201

Respekt: 130
Respekt: 130

piotr172 co ty w ogole piszesz? Musi miec strone serwera i bedzie dzialalo

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-05, 14:07


P.Wiśnia

Programista LUA






Wiek: 25
Na forum: 4186 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 378

Respekt: 100
Respekt: 100

To Ma Tak Wyglonda?


local districtsBus = {

    {45.83,1201.23,18.81},
    {-66.73,1201.60,19.59},
    {-68.33,1148.97,19.59},
    {24.26,1144.16,19.59},
    {26.12,1102.61,19.59},
    {-65.06,1101.15,19.59},
    {-185.69,1100.93,19.60},
    {-188.17,1193.49,19.55},
    {-115.97,1196.37,19.59},
    {-117.24,1251.94,17.41},
    {-73.71,1256.68,12.09},
    {64.41,1220.31,18.83}
   
}

local jobTarget
local jobMarker
local jobVehicle
local maxTarget = #districtsBus

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
    
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 == #districtsBus then
        finishJob()
        playSoundFrontEnd(5)
        outputChatBox("* Zako?czy?e?/a? prac?.")
    else
        showMarker()
        playSoundFrontEnd(12)
        triggerServerEvent("givePlayerMoney", localPlayer, 5, 0)
    end
end

function showMarker()
    if jobMarker and isElement(jobMarker) then
        destroyElement(jobMarker)
        jobMarker = nil
    end
    
    jobTarget = jobTarget + 1
    jobMarker = createMarker(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3], "checkpoint", 4, 0, 0, 255)
    
    if districtsBus[jobTarget+1] then
        ile = districtsBus[jobTarget+1]
        setMarkerTarget(jobMarker, ile[1], ile[2], ile[3])
    end
    
    addEventHandler("onClientMarkerHit", jobMarker, busDriver)
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(plr, seat)
    if seat == 0 then
        if plr == localPlayer then
            finishJob()
            outputChatBox("* Zako?czy?e? prac?")
        end
    end


local jobTarget
local jobMarker
local jobVehicle
local maxTarget = #districtsBus

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
    
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 == #districtsBus then
        finishJob()
        playSoundFrontEnd(5)
        outputChatBox("* Zako?czy?e?/a? prac?.")
    else
        showMarker()
        playSoundFrontEnd(12)
        triggerServerEvent("givePlayerMoney", localPlayer, 5, 0)
    end
end

function showMarker()
    if jobMarker and isElement(jobMarker) then
        destroyElement(jobMarker)
        jobMarker = nil
    end
    
    jobTarget = jobTarget + 1
    jobMarker = createMarker(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3], "checkpoint", 4, 0, 0, 255)
    
    if districtsBus[jobTarget+1] then
        ile = districtsBus[jobTarget+1]
        setMarkerTarget(jobMarker, ile[1], ile[2], ile[3])
    end
    
    addEventHandler("onClientMarkerHit", jobMarker, busDriver)
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(plr, seat)
    if seat == 0 then
        if plr == localPlayer then
            finishJob()
            outputChatBox("* Zako?czy?e? prac?")
        end
    end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-05, 14:08


Loop

Inspektor






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

Piwa: 201

Respekt: 130
Respekt: 130

i tak nie bedzie dzialalo

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-05, 14:12


P.Wiśnia

Programista LUA






Wiek: 25
Na forum: 4186 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 378

Respekt: 100
Respekt: 100

To jak Ma To Wyglonda?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-05, 14:13


piotr172







Wiek: 27
Na forum: 4558 dni
Posty: 130

Piwa: 2329

Respekt: 105,3
Respekt: 105,3

Masz stron? serwera:


local positionVehicles = {
    {2467.77051, 1762.88574, 10.79088},
    {2467.77051-5, 1762.88574, 10.79088},
    {2467.77051-10, 1762.88574, 10.79088},
    {2467.77051-15, 1762.88574, 10.79088},
}

for i,v in ipairs(positionVehicles) do
    local pojazd = createVehicle(437, v[1], v[2], v[3], 1.3, 0.1, 358.8)
    setElementFrozen(pojazd, true)
end

addEventHandler("onVehicleEnter", resourceRoot, function(plr, seat)
    if seat == 0 then
        setElementFrozen(source, false)
        setElementData(plr, "gracz_praca", true)
        outputChatBox("* Rozpocz??e?/a? prac?.", plr)
        triggerClientEvent(plr, "STARTJobBus", resourceRoot)
    end
end)

function respawnVehicles()
    for i,v in ipairs(getElementsByType("vehicle", resourceRoot)) do
        if not getVehicleOccupant(v) then
            respawnVehicle(v)
            setElementFrozen(v, true)
        end
    end
end
setTimer(respawnVehicles, 60000, 0)
addEvent("destroyVeh", true)
addEventHandler("destroyVeh", respawnVehicles)


Zmien sobie tylko pozycje autobus?w.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-05, 14:15


P.Wiśnia

Programista LUA






Wiek: 25
Na forum: 4186 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 378

Respekt: 100
Respekt: 100

ale to nie ma sie respiac autobus w tych miejscach

[ Dodano: 2015-06-05, 14:17 ]
I nie Dzi?a

[ Dodano: 2015-06-05, 14:19 ]
Dobra Zacznijmy Od Pocz?tku Mam Tem Plik Client

local districtsBus = {

    {-114.79,1152.61,19.59},
    {-113.12,1164.50,19.59},
    {-113.60,1199.11,19.59},
    {-127.06,1201.98,19.58},
    {-196.87,1199.95,19.59},
    {-197.96,1098.40,19.59},
    {-198.57,1004.90,19.57},
    {-296.61,813.30,14.57},
    {-126.70,818.83,20.83},
    {-126.26,757.93,20.73},
    {-290.20,687.47,18.60},
    {-228.52,623.31,10.01},
    {-144.33,629.61,2.10},
    {-128.91,535.68,7.17},
    {-94.20,540.26,6.87},
    {18.04,619.35,8.39},
    {157.71,694.35,6.12},
    {259.92,725.92,7.96},
    {342.65,699.74,8.53},
    {350.67,706.68,8.64},
    {281.32,853.33,19.40},
    {221.27,990.38,28.25},
    {188.80,1142.70,14.67},
    {161.58,1158.86,14.58},
    {119.18,1201.64,18.23},
    {-44.09,1201.39,19.21},
    {-116.03,1201.02,19.59},
    {-119.11,1155.33,19.59},
    {-141.06,1151.08,19.59},
    {-143.07,1128.69,19.75},
}

local jobTarget
local jobMarker
local jobVehicle
local maxTarget = #districtsBus

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
    
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 == #districtsBus then
        finishJob()
        playSoundFrontEnd(5)
        outputChatBox("* Zako?czy?e?/a? prac?.")
    else
        showMarker()
        playSoundFrontEnd(12)
        triggerServerEvent("givePlayerMoney", localPlayer, 10, 0)
    end
end

function showMarker()
    if jobMarker and isElement(jobMarker) then
        destroyElement(jobMarker)
        jobMarker = nil
    end
    
    jobTarget = jobTarget + 1
    jobMarker = createMarker(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3], "checkpoint", 4, 0, 0, 255)
    
    if districtsBus[jobTarget+1] then
        ile = districtsBus[jobTarget+1]
        setMarkerTarget(jobMarker, ile[1], ile[2], ile[3])
    end
    
    addEventHandler("onClientMarkerHit", jobMarker, busDriver)
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(plr, seat)
    if seat == 0 then
        if plr == localPlayer then
            finishJob()
            outputChatBox("* Zako?czy?e? prac?")
        end
    end
end)


I co Teraz

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-05, 16:53


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4536 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Aidis, popraw troch? estetyk? swojego pisania. Pisz zgodnie z ortografi? oraz wielkimi literami tylko zaczynaj zdania bo to a? razi w oczy.

Podpis

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

 
Tagi: poprawicie :: mnie :: skrypcie
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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