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

Wysłany: 2018-09-23, 11:59


czlowiekjaja







Wiek: 20
Na forum: 2991 dni
Posty: 76
Nick w MP: czlowiekjaja

Piwa: 324

Respekt: 50

Witam mam tutaj taki kod ale co? nie dzia?a prosi?bym o pomoc.
Kod:
addEventHandler("onClientMarkerHit", getRootElement(),
    function(plr)
        if source == rozpocznij then else return end
            if getElementType(plr) == "player" then else return end
                if isElementWithinMarker(plr, rozpocznij) then else return end
                pojazd = getPedOccupiedVehicle(plr)
                if pojazd then return end
                local now = getTickCount()
                local endTime = start + 10000
                local elapsedTime = now - start
                local duration = endTime - start
                local progress = elapsedTime / duration
                a1 = interpolateBetween(0, 0, 0, 255, 0, 0, progress, "Linear")
                guiSetAlpha(window1, a1)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-23, 12:16


nanKy







Wiek: 23
Na forum: 4006 dni
Posty: 498
Nick w MP: nanky

Piwa: 1775

Respekt: 239
Respekt: 239Respekt: 239

"Indeed it makes more sense to use it with onClientRender/onClientPreRender but the freedom is given to use it in any other context."

U?yj interpolacji w evencie onClientRender.

Czyli...


addEventHandler("onClientMarkerHit", getRootElement(),
    function(plr)
        if source == rozpocznij then else return end
            if getElementType(plr) == "player" then else return end
                if isElementWithinMarker(plr, rozpocznij) then else return end
                pojazd = getPedOccupiedVehicle(plr)
                if pojazd then return end
                addEventHandler('onClientRender',root,animation)
end)

function animation()
 local now = getTickCount()
 local endTime = start + 10000
 local elapsedTime = now - start
 local duration = endTime - start
 local progress = elapsedTime / duration
 a1 = interpolateBetween(0, 0, 0, 255, 0, 0, progress, "Linear")
 guiSetAlpha(window1, a1)
end


Postaw piwo autorowi tego posta
 

 
Tagi: animacja :: alphy
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