Jump to content

Open Login Panel after 50 Seconds.


Karuzo

Recommended Posts

Posted

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.

Posted
function HandleTheRendering ( ) 
    setTimer(function() 
        addEventHandler("onClientRender", getRootElement(), renderDisplay) 
    end, 50000, 1) 
end 
addEventHandler("onClientPlayerJoin", getRootElement(), HandleTheRendering) 

Try this, should work I think.

Posted
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) 
  

Posted (edited)

Thank you @.:HyPeX:.: it works now , BUT, it causes extremeeeely laggs if the loginpanel pops out. and i can't press any button also...

Edited by Guest
Posted
Thank you @.:HyPeX:.: it works now , BUT, it causes extremeeeely laggs if the loginpanel pops out. and i can't press any button also...

Full code :

http://pastebin.com/3i94jTq7

How would you define extreme lags? is it a FPS issue, or the server lags?

And by the way, my timer is just to replace his timer, you should have the full function.

Posted

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.

Posted
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) 

Posted
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 :/

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