Puma Posted February 22, 2011 Posted February 22, 2011 This works: setTimer(function () removeEventHandler("onClientRender", getRootElement(), clientRenderLogo) end, 5000, 1) This doesn't: setTimer(removeEventHandler, 5000, 1, "onClientRender", getRootElement(), clientRenderLogo) Why doesn't the second way work? "The total IQ of the world is a constant. The more people, the more idiots." - Anonymous.
Castillo Posted February 22, 2011 Posted February 22, 2011 A friend had the same problem o_o, maybe it's a bug? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
#Paper Posted February 22, 2011 Posted February 22, 2011 This works: setTimer(function () removeEventHandler("onClientRender", getRootElement(), clientRenderLogo) end, 5000, 1) This doesn't: setTimer(removeEventHandler, 5000, 1, "onClientRender", getRootElement(), clientRenderLogo) Why doesn't the second way work? i think that the 1° works just because the timer need the function () ....... end and you can't insert just removeEventHandler but you must connect a function writed by you, not a function like removeEventHandler . My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Castillo Posted February 22, 2011 Posted February 22, 2011 What? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
#Paper Posted February 22, 2011 Posted February 22, 2011 What? omg My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
DiSaMe Posted February 22, 2011 Posted February 22, 2011 setTimer needs the function and it's all fine about that. function() ... end is a function definition, while removeEventHandler is a variable which holds the function. I see where the real problem may be. If the function clientRenderLogo is defined after the timer is created, then it means that nil value was used as a parameter for removeEventHandler. So you need to move setTimer after the function definition. But if it's already done in this way, I don't know what is the problem. -
#Paper Posted February 22, 2011 Posted February 22, 2011 setTimer needs the function and it's all fine about that. function() ... end is a function definition, while removeEventHandler is a variable which holds the function. I see where the real problem may be. If the function clientRenderLogo is defined after the timer is created, then it means that nil value was used as a parameter for removeEventHandler. So you need to move setTimer after the function definition. But if it's already done in this way, I don't know what is the problem. i meant that My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now