Jump to content

help


Hugos

Recommended Posts

Would you please tell me how to remove the trigger?

For example:

triggerEvent("trig", resourceRoot)

addEvent("trig", true)
function trig()
 	...
end
addEventHandler("trig", resourceRoot, trig)

...how to remove it?

Edited by Hugos
Link to comment
Just now, Overkillz said:

Just use a boolean to check if is running or not.


triggerEvent("trig", resourceRoot)

local isRunning = false
addEvent("trig", true)
function trig()
	if not isRunning then
		isRunning = true
		...
	end
end
addEventHandler("trig", resourceRoot, trig)

Such an option is not suitable.

Link to comment
Just now, Overkillz said:

Could you just tell me why not ?

I have never used this, but you can try.


triggerEvent("trig", resourceRoot)

addEvent("trig", true)
function trig()
 	...
	removeEventHandler("trig", resourceRoot, trig)
end
addEventHandler("trig", resourceRoot, trig)

 

Triggers are not deleted like this.

Link to comment
Just now, IIYAMA said:

Triggers can't be deleted, only prevented by not trigger them.

If it is not possible to delete, then such a question:
I have "guiCreateStaticImage," and I use "onClientGUIClick" for the image.
What function do I need to add them to avoid using a trigger?

Edited by Hugos
Link to comment

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