Piorun Posted June 16, 2011 Share Posted June 16, 2011 Hi guys. I've got code: addEventHandler("onClientResourceStart", getRootElement(), function() mainPlayer = getLocalPlayer() local data = getElementData(mainPlayer, "logged") if data==false then outputDebugString("Started") triggerServerEvent("onClientConnectToSerwer", getRootElement(), mainPlayer) end end) Why when i start my server and join into i see two times "Started"?? And why when i restart resource i see only once? Link to comment
JR10 Posted June 16, 2011 Share Posted June 16, 2011 Because: addEventHandler("onClientResourceStart", getRootElement(), Should be: addEventHandler("onClientResourceStart", resourceRoot, getRootElement = all Resources resourceRoot = this resource only Link to comment
Piorun Posted June 16, 2011 Author Share Posted June 16, 2011 Holy motherf***er .. nice, it's working ... Thanks a lot. 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