Xwad Posted November 21, 2017 Share Posted November 21, 2017 Is it possible to prevent trggerServerEvent and TriggerClientEvent from triggering other resources? Thanks Link to comment
Awang Posted November 21, 2017 Share Posted November 21, 2017 If you want to ignore the Event what triggered from other resource, you just not write a Handler for it. But if you want to stop/kill you can use: cancelEvent() Link to comment
Moderators IIYAMA Posted November 21, 2017 Moderators Share Posted November 21, 2017 (edited) By defining the resourceRoot as source element and attach it at the other side with the resourceRoot as well. Client triggerServerEvent("event", resourceRoot) theElement: The element that is the source of the event. Server addEvent("event", true) addEventHandler("event", resourceRoot, attachedTo: The element you wish to attach the handler to. The handler will only be called when the event it is attached to is triggered for this element, or one of its children. Often, this can be the root element (meaning the handler will be called when the event is triggered for any element). https://wiki.multitheftauto.com/wiki/AddEventHandler The source element is LINKED to the attachedTo element. The attachedTo element will only accept the same element or the children of that same element. The triggerEventSystem is a global system and the events will always be global accessible. You have to do this for every resource that uses the same event name. The root element will accepts everything, included resourceRoot's. Edited November 21, 2017 by IIYAMA 2 Link to comment
Xwad Posted November 21, 2017 Author Share Posted November 21, 2017 It works now, thanks! 1 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