GhostXoP Posted June 20, 2012 Share Posted June 20, 2012 When i add an event handler to an event, does this release the last eventhandler and replace it with a new one? or is the new and the old event handler called? Link to comment
Castillo Posted June 20, 2012 Share Posted June 20, 2012 You can attach as many event handlers as you want. E.g: function test ( ) end addEventHandler ( "onPlayerJoin", root, test ) addEventHandler ( "onPlayerQuit", root, test ) addEventHandler ( "onPlayerLogin", root, test ) Link to comment
GhostXoP Posted June 20, 2012 Author Share Posted June 20, 2012 Edit: I mean, can i set many handlers, for one event? Link to comment
Castillo Posted June 20, 2012 Share Posted June 20, 2012 You mean this? function test ( ) end addEventHandler ( "onPlayerJoin", "onPlayerQuit", root, test ) Then no. I guess you can make a custom function to add event handlers. Link to comment
GhostXoP Posted June 20, 2012 Author Share Posted June 20, 2012 You mean this? function test ( ) end function test2 ( ) end addEventHandler ( "onPlayerJoin", root, test ) addEventHandler ( "onPlayerJoin", root, test2 ) Is what i mean. Would the same event call both functions? Or would test2 replace test Link to comment
Castillo Posted June 20, 2012 Share Posted June 20, 2012 Yes, it'll call both functions. Link to comment
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