Jump to content

remove dx message after 5 seconds


Stevenn

Recommended Posts

Posted
function dxText ( ) 
    dxDrawText("my message",511.0,354.0,995.0,637.0,tocolor(255,255,255,255),1.5,"pricedown","left","top",false,false,false) 
end 
  
   
addEventHandler('onClientResourceRoot', root, 
    function(reason) 
        addEventHandler ( "onClientRender", root, dxText ) 
        setTimer ( 
            function ( ) 
                removeEventHandler ( "onClientRender", root, dxText ) 
            end 
            ,5000,1 
        ) 
    end 
) 

no debugs, but no message either.

Posted

May I ask what the hell is "onClientResourceRoot"? that event doesn't exists, nor makes any sense.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

try this:

function dxText ( ) 
    dxDrawText("my message",511.0,354.0,995.0,637.0,tocolor(255,255,255,255),1.5,"pricedown","left","top",false,false,false) 
end 
  
  
addEventHandler('onClientResourceStart', resourceRoot,function() 
    addEventHandler ( "onClientRender", root, dxText ) 
    setTimer(removeEventHandler,5000,1,"onClientRender",root,dxText) 
end) 

@Solid, come on, he might not have overstand what it really means...

He attempted the script and you should've helped...

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

Posted

lol, it's 4:50 am and i'm quite tired, i obviously meant onClientResourceStart and it works now, thanks for the sarcastic comment though solid.

@Jay thanks.

Posted

Hey Stevenn you are old Steve owner of SANL:RPG you are creating a server called SAIC:RPG?

Mta is good

RPG is even better

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