undefined Posted June 9, 2014 Posted June 9, 2014 Hi Guys. Im work on the help panel. I tried to make the opening of the panel to be transparent. But the "R" Nothing happens when I press the button. Also its not give error and warning on debugscript. Im how to make the transparent opening? function open() if (guiGetVisible (helpMenu) == true) then if guiGetAlpha(helpMenu) >= 65 then setTimer(function() if not guiGetAlpha(helpMenu) <= 0 then guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)-5)) end end,50,0) guiSetVisible(helpMenu, false) showCursor(false) end elseif (guiGetVisible (helpMenu) == false) then if guiGetAlpha(helpMenu) <= 0 then setTimer(function() if not guiGetAlpha(helpMenu) >= 65 then guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)+5)) end end,50,0) guiSetVisible(helpMenu, true) showCursor(true) end end end bindKey ("R", "down", open)
Memory Posted June 9, 2014 Posted June 9, 2014 Try local timer; function open() if (guiGetVisible (helpMenu) == true) then if isTimer ( timer ) then killTimer ( timer ) end timer = setTimer(function() if not guiGetAlpha(helpMenu) <= 0 then guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)-5)) else guiSetVisible(helpMenu, false) showCursor(false) killTimer(timer) end end,50,0) elseif (guiGetVisible (helpMenu) == false) then if isTimer ( timer ) then killTimer ( timer ) end timer = setTimer(function() if not guiGetAlpha(helpMenu) >= 65 then guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)+5)) else guiSetVisible(helpMenu, true) showCursor(true) killTimer(timer) end end,50,0) end end bindKey ("R", "down", open) Ingame name: [sV]Kostya Name in scripts: Kostya
Cadell Posted June 9, 2014 Posted June 9, 2014 Bro alpha lie between 0-1 Script Trading Status Successful Trading : 26 Scam : 0 On Sale : Banking System SQL Based On Sale : Housing System MySQL Based Download and Support my new script on Community : http://community.mtasa.com/index.php?p=resources&s=details&id=11686 SQL Based Housing
Den. Posted June 9, 2014 Posted June 9, 2014 Read the wiki guiSetAlpha. The alpha given to this function should range from 0 to 1.
undefined Posted June 9, 2014 Author Posted June 9, 2014 Try local timer; function open() if (guiGetVisible (helpMenu) == true) then if isTimer ( timer ) then killTimer ( timer ) end timer = setTimer(function() if not guiGetAlpha(helpMenu) <= 0 then guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)-5)) else guiSetVisible(helpMenu, false) showCursor(false) killTimer(timer) end end,50,0) elseif (guiGetVisible (helpMenu) == false) then if isTimer ( timer ) then killTimer ( timer ) end timer = setTimer(function() if not guiGetAlpha(helpMenu) >= 65 then -- Line 85 guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)+5)) else guiSetVisible(helpMenu, true) showCursor(true) killTimer(timer) end end,50,0) end end bindKey ("R", "down", open) It's not work..! ;
#DRAGON!FIRE Posted June 9, 2014 Posted June 9, 2014 P.S : u can use function ( setAlphaGradually ) for all GUI Elements . setAlphaGradually = function( element, Speed ) if ( isElement( element ) and getElementType( element ):find( "gui-" ) and tonumber( Speed ) and tonumber( Speed ) >= 50 ) then if ( isTimer( Timer ) ) then killTimer( Timer ) end guiSetAlpha ( element, 0 ) Timer = setTimer ( function ( ) guiSetAlpha ( element, guiGetAlpha ( element ) + 0.03 ) if ( guiGetAlpha ( element ) == 1 ) then killTimer( Timer ) end end, Speed, 0 ) else return false end end bindKey( "R", "down", function( ) setAlphaGradually( helpMenu, 70 ) guiSetVisible( helpMenu, not guiGetVisible( helpMenu ) ) showCursor( guiGetVisible( helpMenu ) ) end ) To Contact Me at Skype : [email protected]
xXMADEXx Posted June 10, 2014 Posted June 10, 2014 Is the MTA Forum becoming the new Twittter or something? The Ultimate Lua Tutorial! | MTA PHP SDK
Memory Posted June 10, 2014 Posted June 10, 2014 local timer; function open() if (guiGetVisible (helpMenu) == true) then if isTimer ( timer ) then killTimer ( timer ) end timer = setTimer(function() if not guiGetAlpha(helpMenu) <= 0 then guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)-0.05)) else guiSetVisible(helpMenu, false) showCursor(false) killTimer(timer) end end,50,0) elseif (guiGetVisible (helpMenu) == false) then if isTimer ( timer ) then killTimer ( timer ) end guiSetVisible(helpMenu, true) guiSetAlpha(helpMenu, 0) timer = setTimer(function() if not guiGetAlpha(helpMenu) >= 0.65 then -- Line 85 guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)+0.05)) else showCursor(true) killTimer(timer) end end,50,0) end end bindKey ("R", "down", open) Ingame name: [sV]Kostya Name in scripts: Kostya
undefined Posted June 10, 2014 Author Posted June 10, 2014 local timer; function open() if (guiGetVisible (helpMenu) == true) then if isTimer ( timer ) then killTimer ( timer ) end timer = setTimer(function() if not guiGetAlpha(helpMenu) <= 0 then guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)-0.05)) else guiSetVisible(helpMenu, false) showCursor(false) killTimer(timer) end end,50,0) elseif (guiGetVisible (helpMenu) == false) then if isTimer ( timer ) then killTimer ( timer ) end guiSetVisible(helpMenu, true) guiSetAlpha(helpMenu, 0) timer = setTimer(function() if not guiGetAlpha(helpMenu) >= 0.65 then -- Line 85 guiSetAlpha(helpMenu, (guiGetAlpha(helpMenu)+0.05)) else showCursor(true) killTimer(timer) end end,50,0) end end bindKey ("R", "down", open) It's not work. It's solved. Thank you # ZĀ!ـحF ๛..!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now