Wysłany: 2016-09-26, 15:46
ZZiomek
..::LUA::..
Wiek: 26 Na forum: 3867 dni Posty: 134
Nick w MP: NexBoy
Piwa : 5961
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
Wysłany: 2016-09-26, 22:06
Brzysiek
Skrypter pralek
Wiek: 27 Na forum: 5198 dni Posty: 488
Nick w MP: Brzysiek
Piwa : 1034
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 )
Tagi: zanikanie :: tekstu
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: