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

Wysłany: 2021-01-28, 22:33


NoKill1997

Online






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

Piwa: 783

Respekt: 80,5

Witam, mam problem z Timerem. Mianowicie nie dzia?a mi do konca fadeCamera poniewaz wykrywa z?y argument.

Linijka B??du:
Kod:

/rpg_jobTest/s.lua:80: Bad argument @ 'fadeCamera' [Expected element at argument 1, got nil]


Kod kt?rego u?ywam:

addEvent("KradziezAutPoziomI",true)
addEventHandler("KradziezAutPoziomI",root,function()
level = getElementData(source, "level") or 0
prawko = getElementData(source, "prawko_c") or 0
przejazdy = getElementData(source, "pLawety") or 0
if prawko == 0 then
    exports.ad_notifications:addNotification(source, "Nie posiadasz prawa jazdy kategorii C.", "error")
    return
end
if level < 30 then
        exports.ad_notifications:addNotification(source, "Aby pracowa? w tej pracy musisz posiada? minimum 30 poziom!", "error")
    else
        fadeCamera(source ,false)
        setElementData(source, "pracuje:zlodziej", true)
        setElementData(source, "pozycja:zlodziej", 1)
        setElementData(source, "zlodziej:poziom", 1)
        exports.ad_notifications:addNotification(source, "Kradniesz pojazd..", "info")
        notes = math.random( 1, #PojazdyZwykle )
        pojazd[source] = createVehicle(PojazdyZwykle[notes][1], PojazdyZwykle[notes][2], PojazdyZwykle[notes][3], PojazdyZwykle[notes][4], PojazdyZwykle[notes][5], PojazdyZwykle[notes][6], PojazdyZwykle[notes][7])
        setVehiclePlateText(pojazd[source], "ZLODZIEJ")
        setElementData(pojazd[source], "nametag", "Z?odziej\nPOZIOM: #3388ffI")
        warpPedIntoVehicle(source, pojazd[source], 0)
        triggerClientEvent(source, "zlodziej:cel", source)
        triggerClientEvent("kolizjaPojazd", source, pojazd[source])
        setTimer(function ()
            fadeCamera(source, true)
            exports.ad_notifications:addNotification(source, "Uda?o Ci si? ukra?? samoch?d!", "success")
        end, 3500, 1)
    end
end)


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

 
Wysłany: 2021-01-28, 23:20


MrVip615

witam






Wiek: 22
Na forum: 4448 dni
Posty: 167
Nick w MP: ramzes

Piwa: 207

Respekt: 85,3


addEvent("KradziezAutPoziomI",true)
addEventHandler("KradziezAutPoziomI",root,function()
level = getElementData(source, "level") or 0
prawko = getElementData(source, "prawko_c") or 0
przejazdy = getElementData(source, "pLawety") or 0
if prawko == 0 then
    exports.ad_notifications:addNotification(source, "Nie posiadasz prawa jazdy kategorii C.", "error")
    return
end
if level < 30 then
        exports.ad_notifications:addNotification(source, "Aby pracowa? w tej pracy musisz posiada? minimum 30 poziom!", "error")
    else
        fadeCamera(source ,false)
        setElementData(source, "pracuje:zlodziej", true)
        setElementData(source, "pozycja:zlodziej", 1)
        setElementData(source, "zlodziej:poziom", 1)
        exports.ad_notifications:addNotification(source, "Kradniesz pojazd..", "info")
        notes = math.random( 1, #PojazdyZwykle )
        pojazd[source] = createVehicle(PojazdyZwykle[notes][1], PojazdyZwykle[notes][2], PojazdyZwykle[notes][3], PojazdyZwykle[notes][4], PojazdyZwykle[notes][5], PojazdyZwykle[notes][6], PojazdyZwykle[notes][7])
        setVehiclePlateText(pojazd[source], "ZLODZIEJ")
        setElementData(pojazd[source], "nametag", "Z?odziej\nPOZIOM: #3388ffI")
        warpPedIntoVehicle(source, pojazd[source], 0)
        triggerClientEvent(source, "zlodziej:cel", source)
        triggerClientEvent("kolizjaPojazd", source, pojazd[source])
        plr=source
        setTimer(function ()
            fadeCamera(plr, true)
            exports.ad_notifications:addNotification(plr, "Uda?o Ci si? ukra?? samoch?d!", "success")
        end, 3500, 1)
    end
end)


Postaw piwo autorowi tego posta
 

 
Tagi: argument :: timerze
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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