Jump to content
RAGE Multiplayer Community

Events' "this" not working.


rt-2
 Share

Recommended Posts

Hello everyone,
I previously used 'var.destroy();' successfuly, now I wanted to try the new event functions.

When I try to use the new 'this' in events it doesn't work AT ALL.

mp.events.add('anEvent', function (arg) {

     this.handler //Undefined???

     this.cancel //Undefined???

});


new mp.Events('anEvent', function (arg) {

     this.handler //Undefined???

     this.cancel //Undefined???

});


mp.events.add('anEvent', (arg) => {

     this.handler //Undefined???

     this.cancel //Undefined???

});


new mp.Events('anEvent', (arg) => {

     this.handler //Undefined???

     this.cancel //Undefined???

});


and this.handler.destroy() also returns an error.

After asking in the discord channel it seems like nobody could tell me if they ever used it or what was wrong.

Maybe it works but AS DESCRIBED in the changelog it doesn't work.


Thank you,

rt-2

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
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...