Jump to content

Smooth gui open


DakiLLa

Recommended Posts

ehm, i have made something, but no result..where i have mistakes ?

g_res_root = getResourceRootElement ( getThisResource () ) 
  
addEventHandler ( "onClientResourceStart", g_res_root, 
    function () 
        x, y = guiGetScreenSize () 
        p_wnd = guiCreateWindow ( x-280, y-600, 243, 164, "test", false ) 
        close () 
    end 
) 
  
function close (  ) 
    local currentAlpha = guiGetAlpha ( p_wnd ) 
    local newAlpha = currentAlpha - 4 
    if newAlpha < 0 then newAlpha = 0 end 
    guiSetAlpha ( p_wnd, newAlpha ) 
    if newAlpha ~= 0 then 
        setTimer ( open, 50, 1, p_wnd ) 
    end 
end 

Link to comment
g_res_root = getResourceRootElement ( getThisResource () ) 
  
addEventHandler ( "onClientResourceStart", g_res_root, 
    function () 
        x, y = guiGetScreenSize () 
        p_wnd = guiCreateWindow ( x-280, y-600, 243, 164, "test", false ) 
        close () 
    end 
) 
  
function close (  ) 
    local currentAlpha = guiGetAlpha ( p_wnd ) 
    local newAlpha = currentAlpha - 4 
    if newAlpha < 0 then newAlpha = 0 end 
    guiSetAlpha ( p_wnd, newAlpha ) 
    if newAlpha ~= 0 then 
        setTimer ( close, 50, 1, p_wnd ) 
    end 
end 

Try this? You put open in the timer while there's no open. :P

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...