sanyisasha Posted October 25, 2015 Share Posted October 25, 2015 Hi. I have a resource structure: resource -server1.lua --function getHandler()... -server2.lua --function getUsernameByID()... So. The getMySQLHandler return the dbConnect handler. If i use it in another resource, like "resource2", it's working fine. But if i wanna use it in server2.lua, i can't call it. I tried exports.core:getHandler(), core:getHandler(), getHandler()... But always i get an error: except db-connection, get boolean. How can i "self" cast the "getHandler()" in server2.lua? Thanks for the help ^^ Link to comment
sanyisasha Posted October 26, 2015 Author Share Posted October 26, 2015 Fixed. addEvent("getHandlerSelf",true) addEventHandler("getHandlerSelf",getRootElement(),function(handler) DB = handler end) 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