Jump to content

Open Login Panel after 50 Seconds.


Karuzo

Recommended Posts

Hey Guys,

i want to set a Timer to show the Login-Panel after 50 Seconds.

function HandleTheRendering ( ) 
    setTimer(HandleTheRendering,50000,1) 
    addEventHandler("onClientRender", getRootElement(), renderDisplay)  -- Keep everything visible with onClientRender. 
end 
addEventHandler("onClientPlayerJoin", getRootElement(), HandleTheRendering) 

But it won't work :/

btw no errors.

Link to comment
function HandleTheRendering ( ) 
    setTimer(function() 
        addEventHandler("onClientRender", getRootElement(), renderDisplay) 
    end, 50000, 1) 
end 
addEventHandler("onClientPlayerJoin", getRootElement(), HandleTheRendering) 

Try this, should work I think.

Link to comment
function HandleTheRendering ( ) 
    setTimer(function() 
        addEventHandler("onClientRender", getRootElement(), renderDisplay) 
    end, 50000, 1) 
end 
addEventHandler("onClientPlayerJoin", getRootElement(), HandleTheRendering) 

Try this, should work I think.

Not really, it should be like this:

  
CrappyTimer =  setTimer(function() 
        addEventHandler("onClientRender", getRootElement(), renderDisplay) 
        CrappyTimer = nil end, 50000, 1) 
  

Link to comment

Well no sorry that was just a mod ^^ :D

Btw i want to start a function after 50 seconds do i have to same justl ike above ?

i have it now :

function start_cl_resource() 
    setTimer(open_log_reg_pannel,50000,1) 
end 
addEventHandler("onClientPlayerJoin",getResourceRootElement(getThisResource()),start_cl_resource) 

But that doesnt work.

Link to comment
addEventHandler("onClientPlayerJoin", getRootElement(), HandleTheRendering) 

Nope. It will execute the code when the player joins, not when the player finishes downloading. Do it like this:

addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),HandleTheRendering) 

Remember to mention that only works on client side :/

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