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

Wysłany: 2016-09-26, 15:46


ZZiomek

..::LUA::..






Wiek: 26
Na forum: 4009 dni
Posty: 134
Nick w MP: NexBoy

Piwa: 5961

Respekt: 155,3
Respekt: 155,3Respekt: 155,3

Witam chcia?bym zrobi? aby tekst, kt?ry si? wyswi?tli? zanika? przy usuni?ciu.
na razie zrobi?em, ?e rozjasnia si?. ale chce te? zrobi? do tego ?eby to zanika?o.

tutaj kod:

local screenW, screenH = guiGetScreenSize()

function InfoSerwer() 
local Alpha = interpolateBetween(0, 0, 0, 255, 220, 200, ((getTickCount() - SX) / 2000), "Linear")     
dxDrawText("Test GUI!", screenW * 0.0000, screenH * 0.3763, rh, screenH * 0.4271, tocolor(255, 255, 255, Alpha), 1.00, "default-bold", "center", "center", false, false, false, false, false)
end

marker = createMarker(-713.49, 972.15, 12.28-1, "cylinder", 1, 255, 0, 0) 

function Pomoc (player)
    if player == getLocalPlayer() then
            addEventHandler("onClientRender",root,InfoSerwer)
                SX = getTickCount()
                playSound("PiP.mp3")
    end
end
addEventHandler( "onClientMarkerHit", infopickup, marker) 


Podpis

Dodaj na Steam: Kod: 1093365219
Discord: NoOne#3644

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-09-26, 22:06


Brzysiek

Skrypter pralek






Wiek: 28
Na forum: 5340 dni
Posty: 488
Nick w MP: Brzysiek

Piwa: 1034

Respekt: 360
Respekt: 360Respekt: 360Respekt: 360Respekt: 360


local fade = false 
local screenW, screenH = guiGetScreenSize()
function InfoSerwer() 
    local now = getTickCount() 
    
    local Alpha = 0 
    local progress = 0 
    if fade then 
        progress = math.min((now-fade) / 2000, 1) -- 2000 to czas zanikania
        Alpha = interpolateBetween(255, 0, 0, 0, 0, 0, progress, "Linear") 
        
        if progress >= 1 then -- tekst zanik?
            fade = false
            removeEventHandler("onClientRender", root, InfoSerwer)
        end
    else 
        progress = math.min((now-SX) / 2000, 1) -- math.min bo progress nie powinien przekracza? 1
        Alpha = interpolateBetween(0, 0, 0, 255, 0, 0, progress, "Linear") 
    end 
         
    dxDrawText("Test GUI!", screenW * 0.0000, screenH * 0.3763, rh, screenH * 0.4271, tocolor(255, 255, 255, Alpha), 1.00, "default-bold", "center", "center", false, false, false, false, false)
end

marker = createMarker(-713.49, 972.15, 12.28-1, "cylinder", 1, 255, 0, 0) 

function Pomoc (player)
    if player == getLocalPlayer() then
        addEventHandler("onClientRender",root,InfoSerwer)
        setTimer(function() fade = getTickCount() end, 3000, 1) -- po 3 sekundach zanika
        SX = getTickCount()
        playSound("PiP.mp3")
    end
end
addEventHandler( "onClientMarkerHit", infopickup, marker) 


Postaw piwo autorowi tego posta
 

 
Tagi: zanikanie :: tekstu
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