Jump to content

Export, calling


Sex*

Recommended Posts

alpha = 255 
  
function updateAlpha ( ) 
    alpha = ( alpha > 0 and alpha - 1 or 255 ) 
end 
setTimer ( updateAlpha, 500, 0 ) 

That'll decrease by 1 the alpha variable. I removed the "guiSetAlpha" because your code has no GUI elements at all, I guess is all DirectX ( DX ), so you need to use the "alpha" variable on tocolor at your drawing function.

Link to comment
Well, thats not working:
  
function changeAlpha ( commandName, alphaAmount ) 
        alphaAmount = 255 
        guiSetAlpha ( RankingBoardDrawing, 255 ) 
setTimer ( delayedRankingBoardDrawing, 4000 ) 
end 
addCommandHandler ( "alpha", changeAlpha ) 

That's obviously wrong, it doesn't make any sense.

Well how it would make sense?

You're missing a parameter in setTimer. You have the function, and interval; but not the amount of times you wish to execute the function. Also, the command you created will completely ignore the alphaAmount portion of the syntax since you forcefully set the value of alphaAmount to 255.

Also, check the post above.

Link to comment

Try this.

function changeAlpha ( _, alphaAmount ) 
    if tonumber ( alphaAmount )  then 
        guiSetAlpha ( RankingBoardDrawing, alphaAmount ) 
    else 
        outputChatBox ( "* Enter Correct Amount : /alpha [amount] ", 255, 0, 0, true ) 
    end 
    --setTimer ( delayedRankingBoardDrawing, 4000 ) 
end 
addCommandHandler ( "alpha", changeAlpha ) 

setTimer is Wrong !

Link to comment

here is an example

alpha = 0; 
screen = { guiGetScreenSize( ) }; 
  
addEventHandler( 'onClientRender', root, 
    function( ) 
        alpha = alpha + 30 
        dxDrawText( '#FF0000Bomb #FFFFFFHas Been Planted. ', screen[ 1 ] / 2, screen[ 2 ] / 2, screen[ 1 ], screen[ 2 ], tocolor ( 0, 0, 0, alpha ), 0.8, 'sa-header', 'center', 'center', false, false, true, true ) 
        if alpha == 255 then  
            alpha = 0 
        end 
    end 
) 

Link to comment
here is an example
alpha = 0; 
screen = { guiGetScreenSize( ) }; 
  
addEventHandler( 'onClientRender', root, 
    function( ) 
        alpha = alpha + 30 
        dxDrawText( '#FF0000Bomb #FFFFFFHas Been Planted. ', screen[ 1 ] / 2, screen[ 2 ] / 2, screen[ 1 ], screen[ 2 ], tocolor ( 0, 0, 0, alpha ), 0.8, 'sa-header', 'center', 'center', false, false, true, true ) 
        if alpha == 255 then  
            alpha = 0 
        end 
    end 
) 

It i'll never be 255.

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...