Spc Posted September 10 Share Posted September 10 (edited) Hello, I have basic custom event that triggers when player logins: triggerEvent("onPlayerHasLogged", client) And it's handled in another resource on global level: addEventHandler("onPlayerHasLogged", root, function() iprint("trigger", source) end) Everything is working just fine but after a random amount of time (sometimes few hours, sometimes less and sometimes a lot more) eventHandler stops triggering completely. triggerEvent still returns true. When i restart the resource with eventHandler, everything works properly again. Handlers of other event triggers that have "client" as base element stop working as well. Does anybody know what may be wrong? Edited September 10 by Spc Link to comment
Moderators IIYAMA Posted September 10 Moderators Share Posted September 10 1 hour ago, Spc said: Does anybody know what may be wrong? Are you using addDebugHook function somewhere in your resources? Also the addEvent function should also be called at the resource where addEventHandler is being used. 1 Link to comment
Spc Posted September 10 Author Share Posted September 10 (edited) 10 minutes ago, IIYAMA said: Are you using addDebugHook function somewhere in your resources? Yes, i'm using addDebugHook for detecting and blocking client-side functions as a form of anti-cheat, for example: addDebugHook("preFunction", ac_checkFunction, DISALLOWED_FUNCTIONS) function ac_checkFunction(sourceRes, funcName, _, _, _, ...) if DISALLOWED_FUNCTIONS[funcName] then triggerServerEvent("onACDetection", localPlayer) return "skip" end end Quote Also the addEvent function should also be called at the resource where addEventHandler is being used. Do you mean adding multiple addEvent functions with same event name? I use this event in multiple resources. Edited September 10 by Spc Link to comment
Moderators IIYAMA Posted September 10 Moderators Share Posted September 10 3 minutes ago, Spc said: Yes, i'm using addDebugHook for detecting and blocking client-side functions as a form of anti-cheat, for example: This function is able to mimic that behaviour you just mentioned. Just be aware. 3 minutes ago, Spc said: Do you mean adding multiple addEvent functions with same event name? I use this event in multiple resources. It might be worthed to look in to it and test if it has any impact if any of those are restarted. Also double check if the remote access is disabled for all of them. (2e argument of addEvent) Link to comment
Spc Posted September 10 Author Share Posted September 10 (edited) 6 minutes ago, IIYAMA said: It might be worthed to look in to it and test if it has any impact if any of those are restarted. Also double check if the remote access is disabled for all of them. (2e argument of addEvent) Remote access is disabled. I'll add addEvents to the resources and i'll reply if it changed something or not. However it is still strange for me, because i've never seen this happen before. Edited September 10 by Spc 1 Link to comment
BranD Posted September 10 Share Posted September 10 In the current situation of MTA:SA the entire client-side is completely exposed even the addDebogHook events can be neutralized by hackers, I recommend you to do more checks on the server-side Link to comment
Spc Posted September 12 Author Share Posted September 12 On 10/09/2024 at 17:20, Spc said: I'll add addEvents to the resources and i'll reply if it changed something or not. The problem stopped occuring. It seems that this did the trick. Thank you for help. 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