Jump to content
  • 0

Check if a EventHandler is alive


Donnovan

Question

Hi!

When i run a event handler like that:

 

myEH_hd = player addEventHandler ["handleDamage",{_this call run_stuff}];
The number of the event handler is stored in myEH_hd.

In my context, there is the possibilitie that another process use the code:

 

player removeAllEventHandlers "handleDamage";
And remove my event handler.

So... there is any way to know if my event handler is still alive?

---------//---------

Also, this, about removeEventHandler, is true?

 

When any handler is removed, all handler indices higher than the deleted one should be decremented.

Sorry if i an asking too much. Thankyou!

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Thankyou Sukkaed,

But the problem is to know if the event handler is alive. I don't know if it was removed, i need to check this.

Something like that:

 

while {state_on} do {
      waitUntil {Is the Event Handler Removed?}; //THIS!
      player addEventHandler ["handleDamage",{_this call run_stuff}];
};
The "waitUntil {Is the Event Handler Removed?};" code is what i'm in search.
Link to comment
Share on other sites

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
  • Discord

×
×
  • Create New...