Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: blokowanie/stopowanie
1. Blokowanie/stopowanie funkcji setTimer
Witam, chcia?bym aby po up?ywie 120 sek Funkcja setTimer poprostu tak jakby si? zatrzymywa?a albo co? w ten dese?. Chcia?bym tak zrobi? aby by?o to bardziej optymalne. Ch?tnie te? poczytam jak to lepiej napisa? ;)

    function ZablokujRespPracy(timer,element)
outputChatBox(timer,element)
    
setElementData (element"player:time_work"timer)
    
        
setTimer(function()
        
local getData tonumber(getElementData (element"player:time_work")) or 0
            
if getElementData(element"player:time_work") < 1 then return end
                
if getData then
                    setElementData 
(element"player:time_work"getData-1)
                
end
            end
10000)

end


[ Dodano: 2020-12-22, 01:59 ]
Nie wa?ne ju? to wy?ej ale teraz jest problem ?e jak gracz wyjdzie z serwera wywala taki b??d

Kod:

WARNING: [Prace]/Praca_core/s.lua:155: Bad argument @ 'getElementData' [Expected element at argument 1] [DUP x5]


[ Dodano: 2020-12-22, 02:00 ]
155 linijka
local getData getElementData(element"player:time_work") or 0