laserlaser Posted May 19, 2012 Posted May 19, 2012 (edited) Hi everyone, I'm scripting the animation class.But I have an problem at timer... It's the first code _G["animateComplete"] = function() -- animate complete content end _G["animateBack"] = function() -- animate back content end anim.animateComplete = animateComplete anim.animateBack = animateBack 2 Function works fine at class functions.EX: function Animation:Play() addEventHandler('onClientRender',getRootElement(),self.animateComplete) end It works.But I Have problem because 2 doesn't work at other functions: function addAnimBack(animfunc) -- outputChatBox(type(animfunc)) but it outputs "nil". addEventHandler("onClientRender",getRootElement(), animfunc)-- this isn't work because it's nil. end function Animation:animFinished() if isTimer(self.backTimer) then -- bla bla else removeEventHandler("onClientRender",getRootElement(), self.animateComplete) if (self.animateProperties.onFinishBack >= 50) then -- outputChatBox(type(self.animateBack)) == It outputs "function" self.backTimer = setTimer(addAnimBack,self.animateProperties.onFinishBack,1,self.animateBack) return end end -- blala blala end Where is the problem? Why timer sends nill ? Edited May 21, 2012 by Guest
Jaysds1 Posted May 20, 2012 Posted May 20, 2012 Sorry that no one replied to this but, if you can, can you change those to tags please, next, what is this animation class? 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/
Kenix Posted May 20, 2012 Posted May 20, 2012 You not define this variable: animfunc http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
laserlaser Posted May 21, 2012 Author Posted May 21, 2012 Sorry that no one replied to this but,if you can, can you change those to tags please, next, what is this animation class? It's for animate the GUI Elements. You not define this variable: animfunc Oh wrong copied.Still doesn't work.
Jaysds1 Posted May 21, 2012 Posted May 21, 2012 Can you pm the whole code and I'll see what's wrong, cause I don't see anything wrong here except for that "animfunc". 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/
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