Jump to content

Another Question. Fast Answer Please.


xScatta

Recommended Posts

Posted

Hey Guyz. I have a question look at the code.

addEventHandler(EventName5,ElementAttached8,function () ... ) 

and i want to do something like this

removeEventHandler(EventName5,ElementAttached8,PROBLEM) 

in PROBLEM how can i specify the function if i don't do another function outside event handler?

It's fine to celebrate success but it is more important to heed the lessons of failure.

Posted

Not entirely sure what you're asking. But I'm assuming you want to be able to add and/or remove an event handler from a function. Simply write it like this;

function exampleCode() 
    if(Something == SomethingElse) then 
        removeEventHandler("SomeEvent", getRootElement(), exampleCode) 
    end 
end 
addEventHandler("SomeEvent", getRootElement(), exampleCode) 

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

Posted

But i mean to remove event handler from function "builded" in event handler not outside.

just like that

Correct

addEventHandler(...,...,function () ... end) 

- - - - - - - - -

Bad

addEventHandler(...,...,FunctionName) 

And i want to remove event handler from the Correct version.

It's fine to celebrate success but it is more important to heed the lessons of failure.

Posted

Not entirely sure if you can do that. Why not just write it like demonstrated?

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

Posted

As far as i know , you can't do that. You must make outside function.

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

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