Jump to content

Can someone help me?


Recommended Posts

  
-- this will draw "hallo" in the middle of the screen for 5 seconds when you use the command hallo 
  
local timer;  
local function draw ()  
    local screenWidth, screenHeight = guiGetScreenSize ();  
    dxDrawText ("hallo", screenWidth/2-50,screenHeight,0,0, tocolor(255,0,0,255), 1, "pricedown"); 
end;  
addCommandHandler ("hallo",  
  function ()  
       if isTimer (timer) then  -- is message shown already? 
           -- if it is, just draw message for 5 more seconds. 
           resetTimer (timer);  
       else  
           -- not, so ... 
           addEventHandler ("onClientRender", getRootElement(), draw);   
            
           -- timer to hide the message 5 seconds later. 
           timer = setTimer (removeEventHandler,5000,1, "onClientRender", getRootElement(), draw);  
       end;  
  end);  
  

Edited by Guest
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...