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

Wysłany: 2021-04-02, 17:32


NoKill1997

Online






Wiek: 29
Na forum: 3365 dni
Posty: 183
Nick w MP: Mefedroniarz.PDW

Piwa: 783

Respekt: 80,5

Witam mam problem z prac? po stronie serwera mianowicie pr?buje zrobi? prac? polegaj?c? na za?adowaniu dostawczka, po czym mo?emy wywie?? towar.
Z grupsza ow? prac? napisa?em lecz mam problem z outputchatboxem oraz funkcjami niekt?rymi, gdy? wykonuj? one si? ka?demu graczowi, kt?ry posiada rozpocz?t? prac?.
Kod:


--------------------------WYWOZ KONOPII


local marker1 = {}
local marker2 = {}
local marker3 = {}
local marker4 = {}
local marker5 = {}
local marker6 = {}
local marker7 = {}
local marker8 = {}
local marker9 = {}
local marker10 = {}
local pojazd = {}
local marker_praca = {}
local blip_praca = {}

addEvent("RozpocznijWywoz",true)
addEventHandler("RozpocznijWywoz",root,function()
--[[    if getElementData (source, "rozpoczeta") == true then return end
        if getElementData (source, "oddaj") == true then return end
        if getElementData (source, "nadruga") == true then return end
        if getElementData (source, "natrzecia") == true then return end
        if getElementData (source, "oddajdwa") == true then return end
        if getElementData (source, "oddajtrzy") == true then return end
        if getElementData (source, "oddalall") == true then return end
        if getElementData (source, "dojazdlegalna") == true then return end
        if getElementData (source, "dojazdnielegalna") == true then return end
        ]]--
    setElementData (source, "rozpoczeta", true)
    setElementData (source, "StartKonopieWywuz", true)
    local iloscTopow = getElementData(source, "Topy")
    outputChatBox("#ffffffRozpocze?e? wyw?? #3388ff"..iloscTopow.."#ffffff top?w, udaj si? do magazynu po topy. Nast?pnie za?aduj je do burrito.", source, 255, 255, 255, true)
    marker1[source] = createMarker (-3380.11, 58.35, 1.30-0.96, "cylinder", 1.2, 0,209,255,0)
    setElementData(marker1[source], "custom_marker", true)
    setElementData (source, "oddaj", false)
    setElementData (source, "nadruga", false)
    setElementData (source, "natrzecia", false)
    setElementData (source, "oddajdwa", false)
    setElementData (source, "oddajtrzy", false)
    setElementData (source, "oddalall", false)
    setElementData (source, "dojazdlegalna", false)
    setElementData (source, "dojazdnielegalna", false)
    setElementData(source, "pracuje:KONOPIE", false)
addEventHandler ("onMarkerHit",marker1[source], kopanie)
end)

function kopanie (el, md)
    if getElementData (el, "rozpoczeta") == true then
        outputChatBox("#ffffffBierzesz paczk? ...", el, 255, 255, 255, true) 
        triggerClientEvent(el, "AnimacjaStart", el)

        setElementFrozen (el, true)
        setTimer ( function ()
        outputChatBox("#ffffffWzie?es  #3388ff1 #ffffffz #3388ff3 #ffffffpaczek ", el, 255, 255, 255, true) 
        outputChatBox("#ffffffUdaj si? do Burrito#ffffff, aby zapakowa? topy na pake!", el, 255, 255, 255, true) 
            setPedAnimation(el, false)
            setElementData (el, "oddaj", true)
            setElementData (el, "rozpoczeta", false)
            setElementFrozen (el, false)
            setPedAnimation (el, false)
            destroyElement (marker1[el])
            marker2[el] = createMarker (-3381.45, 62.42, 1.30-0.96, "cylinder", 1.2, 0,209,255,0)
            setElementData(marker2[el], "custom_marker", true)
            addEventHandler ("onMarkerHit", marker2[el], zaladowanie)
            end, 7000, 1 )
    end
end

function zaladowanie (el, md)
    if getElementData (el, "oddaj") == true then
        outputChatBox("#ffffffOddajesz paczke ...", el, 255, 255, 255, true)  
                setPedAnimation(el, "WASH", "wash_up")
                setElementFrozen (el, true)
        setTimer ( function ()
            outputChatBox("#ffffffOdda?es #3388ff1#ffffff paczk?, udaj si? aby przyniesc nast?pn?!", el, 255, 255, 255, true)  
            setElementFrozen (el, false)
            setElementData (el, "oddaj", false)
            setElementData (el, "nadruga", true)
            destroyElement (marker2[el])
            marker3[el] = createMarker (-3380.11, 58.35, 1.30-0.96, "cylinder", 1.2, 0,209,255,0)
            setElementData(marker3[el], "custom_marker", true)
            addEventHandler ("onMarkerHit",marker3[el], KopanieDwa)
            end, 7000, 1 )
    end
end


function KopanieDwa (el, md)
    if getElementData (el, "nadruga") == true then
        outputChatBox("#ffffffBierzesz paczk? ...", el, 255, 255, 255, true) 
        setElementFrozen (el, true)
        setTimer ( function ()
        outputChatBox("#ffffffWzie?es  #3388ff2 #ffffffz #3388ff3 #ffffffpaczek ", el, 255, 255, 255, true) 
        outputChatBox("#ffffffUdaj si? do Burrito#ffffff, aby zapakowa? topy na pake!", el, 255, 255, 255, true) 
            setElementData (el, "nadruga", false)
            setElementData (el, "oddajdwa", true)
            setPedAnimation (el, false)
            setElementFrozen (el, false)
            destroyElement (marker3[el])
            marker4[el] = createMarker (-3381.45, 62.42, 1.30-0.96, "cylinder", 1.2, 0,209,255,0)
            setElementData(marker4[el], "custom_marker", true)
            addEventHandler ("onMarkerHit", marker4[el], zaladowanieDwa)
            end, 7000, 1 )
    end
end


function zaladowanieDwa (el, md)
    if getElementData (el, "oddajdwa") == true then
        outputChatBox("#ffffffOddajesz paczk? ...", el, 255, 255, 255, true) 
                setPedAnimation(el, "WASH", "wash_up")
                setElementFrozen (el, true)
        setTimer ( function ()
            outputChatBox("#ffffffOdda?es #3388ff1#ffffff paczk?, udaj si? aby przyniesc nast?pn?!", el, 255, 255, 255, true)  
                setElementFrozen (el, false)
                setElementData (el, "oddajdwa", false)
            setElementData (el, "natrzecia", true)
            destroyElement (marker4[el])
            marker5[el] = createMarker (-3380.11, 58.35, 1.30-0.96, "cylinder", 1.2, 0,209,255,0)
            setElementData(marker5[el], "custom_marker", true)
            addEventHandler ("onMarkerHit", marker5[el], kopanieTrzy)
            end, 7000, 1 )
    end
end

function kopanieTrzy (el, md)
    if getElementData (el, "natrzecia") == true then
        outputChatBox("#ffffffBierzesz paczk? ...", el, 255, 255, 255, true) 
        setElementFrozen (el, true)
        setTimer ( function ()
        outputChatBox("#ffffffWzie?es  #3388ff3 #ffffffz #3388ff3 #ffffffpaczek ", el, 255, 255, 255, true) 
        outputChatBox("#ffffffUdaj si? do Burrito#ffffff, aby zapakowa? topy na pake!", el, 255, 255, 255, true)
            setElementData (el, "natrzecia", false)
            setElementData (el, "oddajtrzy", true)
            setPedAnimation (el, false)
            setElementFrozen (el, false)
            destroyElement (marker5[el])
            marker6[el] = createMarker (-3381.45, 62.42, 1.30-0.96, "cylinder", 1.2, 0,209,255,0)
            setElementData(marker6[el], "custom_marker", true)
            addEventHandler ("onMarkerHit", marker6[el], zaladowanieTrzy)
            end, 7000, 1 )
    end
end


function zaladowanieTrzy (el, md)
    if getElementData (el, "oddajtrzy") == true then
        outputChatBox("#ffffffOddajesz paczk? ...", el, 255, 255, 255, true) 
                setPedAnimation(el, "WASH", "wash_up")
                setElementFrozen (el, true)
        setTimer ( function ()
            outputChatBox ("#ffffffWybierz rodzaj przewozu:", el, 255, 255, 255, true)
            outputChatBox ("#ffffffAby rozwie?? marihuane w spos?b ostro?ny wpisz #3388ff/opodatkowana ", el, 255, 255, 255, true)
            outputChatBox ("#ffffffAby rozwie?? marihuane w spos?b nieostro?ny wpisz #3388ff/nieopodatkowany", el, 255, 255, 255, true)
            setElementData (el, "oddajtrzy", false)
            setElementData (el, "oddalall", true)
            setElementFrozen (el, false)
            destroyElement(marker6[el])
            end, 7000, 1 )
    end
end

function opodatkowana (el, md)
    if getElementData (el, "oddalall") == true then
        pojazd[el] = createVehicle (482, 981.98, -1433.44, 13.67, 359.3, 0.3, 181.0)
        warpPedIntoVehicle (el, pojazd[el])
        setVehiclePlateText (pojazd[el], "Legalna")
        setVehicleColor (pojazd[el], 255, 255, 255)
        addVehicleUpgrade (pojazd[el], 1025)
        setElementData (el, "oddalall", false)
        setElementData (el, "KonczyPrace", true)
        setElementData (pojazd[el], "PojazdKONOPIE", true)
        setElementData (el, "dojazdlegalna", true)
        outputChatBox ("#ffffffRozpocze?e? wyw?z Marihuany ", el, 255, 255, 255, true)
        outputChatBox ("#ffffffRodzaj wywozu: #3388ffopodatkowany", el, 255, 255, 255, true)
            marker_praca[el] = createMarker (-2107.51, -2401.92, 31.38-0.96, "cylinder", 3.2, 0,209,255,0)
            setElementData(marker_praca[el], "custom_marker", true)
            blip_praca[el] = createBlipAttachedTo(marker_praca[el], 41)
            addEventHandler ("onMarkerHit", marker_praca[el], OpodatkowanyMarkerRozladunek)
    end
end
addCommandHandler ("opodatkowana", opodatkowana)


function nieopodatkowany (el, md)
        if getElementData (el, "oddalall") == true then
            pojazd[el] = createVehicle (482, 981.98, -1433.44, 13.67, 359.3, 0.3, 181.0)
            warpPedIntoVehicle (el, pojazd[el])
            setVehiclePlateText (pojazd[el], "nieostrozny")
            setVehicleColor (pojazd[el], 0, 0, 0, 255, 255, 255)
            addVehicleUpgrade (pojazd[el], 1025)
            setElementData (el, "oddalall", false)
            setElementData (pojazd[el], "PojazdKONOPIE", true)
            setElementData (el, "dojazdnielegalna", true)
            setElementData (el, "KonczyPrace", true)
            outputChatBox ("#ffffffRozpocze?e? wyw?z Marihuany ", el, 255, 255, 255, true)
            outputChatBox ("#ffffffRodzaj wywozu: #3388ffnieopodatkowany", el, 255, 255, 255, true)
            marker_praca[el] = createMarker (-1819.27, -149.82, 9.40-0.96, "cylinder", 3.2, 0,209,255,0)
            setElementData(marker_praca[el], "custom_marker", true)
            blip_praca[el] = createBlipAttachedTo(marker_praca[el], 41)
            addEventHandler ("onMarkerHit", marker_praca[el], NieOpodatkowanyMarkerRozladunek)
    end
end
addCommandHandler ("nieopodatkowany", nieopodatkowany)

function OpodatkowanyMarkerRozladunek (el, md)
        if getElementData (el, "dojazdlegalna") == true then
        destroyElement (pojazd[el])
        destroyElement (marker_praca[el])
        destroyElement (blip_praca[el])
        outputChatBox ("#ffffffTrwa roz?adowywanie zasobow ...", el, 255, 255, 255, true)
        setElementFrozen (el, true)
        local iloscTopow = getElementData(el, "Topy")
        setTimer ( function ()
                local HajsOpodatkowany = iloscTopow*60
                outputChatBox ("#ffffffZa wykonan? prac? otrzymujesz #3388ff"..HajsOpodatkowany.." #ffffffPLN.", el, 255, 255, 255, true)
                outputChatBox ("#ffffffIlo?? wywiezionych top?w: #3388ff"..iloscTopow.." #ffffff.", el, 255, 255, 255, true)
                setElementData(el,"pieniadze", getElementData(el,"pieniadze")+HajsOpodatkowany)
                setElementData(el, "Topy", 0)
                setElementData(el,"punkty", getElementData(el,"punkty")+30)
                setElementPosition (el,  1004.94, -1437.21, 13.55)
                setElementData (el, "dojazdlegalna", false)
                setElementFrozen (el, false)
                setElementData (el, "rozpoczeta", false)
                setElementData (el, "StartKonopieWywuz", false)
            end, 1000, 1 )
          end
     end

function NieOpodatkowanyMarkerRozladunek (el, md)
        if getElementData (el, "dojazdnielegalna") == true then
        destroyElement (pojazd[el])
        destroyElement (marker_praca[el])
        destroyElement (blip_praca[el])
        outputChatBox ("#ffffffTrwa roz?adowywanie zasobow ...", el, 255, 255, 255, true)
        setElementFrozen (el, true)
        local iloscTopow = getElementData(el, "Topy")
        setTimer ( function ()
            local HajsNieOpodatkowany = iloscTopow*120
                outputChatBox ("#ffffffZa wykonan? prac? otrzymujesz #3388ff"..HajsNieOpodatkowany.." #ffffffPLN.", el, 255, 255, 255, true)
                outputChatBox ("#ffffffIlo?? wywiezionych top?w: #3388ff"..iloscTopow.." #ffffff.", el, 255, 255, 255, true)
                setElementData(el,"pieniadze", getElementData(el,"pieniadze")+HajsNieOpodatkowany)
                setElementData(el, "Topy", 0)
                setElementData(el,"punkty", getElementData(el,"punkty")+30)
                setElementPosition (el,  1004.94, -1437.21, 13.55)
                setElementData (el, "dojazdnielegalna", false)
                setElementFrozen (el, false)
                setElementData (el, "rozpoczeta", false)
                setElementData (el, "StartKonopieWywuz", false)
            end, 1000, 1 )
          end
     end


Podpis
Aktualny projekt: LSgame
Na scenie MTA od: 2015 roku.
Discord: Chwilowoo, brak
Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-02, 18:10


MeeShuffle

Programista/Grafik






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

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Poka? dok?adnie kt?re outputchatboxy s? wed?ug Ciebie z?e i kt?re funkcje

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-03, 00:01


NoKill1997

Online






Wiek: 29
Na forum: 3365 dni
Posty: 183
Nick w MP: Mefedroniarz.PDW

Piwa: 783

Respekt: 80,5

"Shuffle" napisał/a:

Poka? dok?adnie kt?re outputchatboxy s? wed?ug Ciebie z?e i kt?re funkcje
niestety ale wydaje mi si? ?e ca?y ten kod, kt?ry podeslalem ma b??dy. Wydaje mi si? ?e ?le argumentuje (kod napisany by? po stronie Serwera)

Podpis
Aktualny projekt: LSgame
Na scenie MTA od: 2015 roku.
Discord: Chwilowoo, brak
Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-03, 11:17


vAnimo

Zielony w luła






Wiek: 20
Na forum: 2453 dni
Posty: 165
Nick w MP: vAnimo

Piwa: 883

Respekt: 70


Więcej informacji znajdziesz w Wikipedii MTA:

getElementType



Więcej informacji znajdziesz w Wikipedii MTA:

isElementWithinMarker


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-03, 15:15


MeeShuffle

Programista/Grafik






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

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Og?lnie to ca?y ten kod jest napisany chaotycznie.

Musisz mi wskaza? kt?re elementy s? z?e, tu jest 200 linijek kodu, w dodatku kod jest tak dennie zrobiony, ?e nie idzie odczyta?, triggery skacz? co chwil? z sside na cside i na odwr?t, eventy wykonuja funkcje w ktorej sie znajduja :-?

Postaw piwo autorowi tego posta
 

 
Tagi: outputchatbox :: wyświetla :: się :: każdemu.
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