Jump to content

a question about EventHandlers


mrvicio

Recommended Posts

Posted

Hi all, i have a doubt

res = resource

if i have a "addEventHandler" in the res1 atached to a resource-element (res2), and this resource stop

when the res2 start again with a diferent "elementDataxxx", the EventHandler above will work?

  • MTA Team
Posted

You mean in res1 there is

addEventHandler("onResourceStart", res2, dosomething) 

and then res1 is stopped.

Then when res2 starts (and res1 is stopped) it wont work.

WHY?

The event handler is removed when the res is stopped.

Posted (edited)

I mean in res1 there is

addEventHandler("onResourceStart", res2, dosomething) 

and then res2 is stopped.

Then when res2 starts again the

addEventHandler("onResourceStart", res2, dosomething) 

will be triggered?

Edited by Guest

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