Hugos Posted November 2, 2019 Share Posted November 2, 2019 (edited) 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 November 2, 2019 by Hugos Link to comment
Overkillz Posted November 2, 2019 Share Posted November 2, 2019 Could you be more specified ? If you want to remove an event to prevent his execution, just, don't execute it. Regards. Link to comment
Hugos Posted November 2, 2019 Author Share Posted November 2, 2019 Just now, Overkillz said: Could you be more specified ? If you want to remove an event to prevent his execution, just, don't execute it. Regards. I need to delete it after running) Link to comment
Overkillz Posted November 2, 2019 Share Posted November 2, 2019 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) Link to comment
Hugos Posted November 2, 2019 Author Share Posted November 2, 2019 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
Overkillz Posted November 2, 2019 Share Posted November 2, 2019 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) Link to comment
Hugos Posted November 2, 2019 Author Share Posted November 2, 2019 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
Moderators IIYAMA Posted November 2, 2019 Moderators Share Posted November 2, 2019 2 minutes ago, Hugos said: Triggers are not deleted like this. Triggers can't be deleted, only prevented by not trigger them. 1 Link to comment
Hugos Posted November 2, 2019 Author Share Posted November 2, 2019 (edited) 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 November 2, 2019 by Hugos Link to comment
Moderators IIYAMA Posted November 2, 2019 Moderators Share Posted November 2, 2019 1 hour ago, Hugos said: I have "guiCreateStaticImage," and I use "onClientGUIClick" for the image. What function do I need to add them to avoid using a trigger? You could disable the element. https://wiki.multitheftauto.com/wiki/GuiSetEnabled Link to comment
Hugos Posted November 4, 2019 Author Share Posted November 4, 2019 On 02/11/2019 at 17:46, IIYAMA said: You could disable the element. https://wiki.multitheftauto.com/wiki/GuiSetEnabled Thanks! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now