qaisjp Posted May 6, 2011 Share Posted May 6, 2011 A quick question. Is addEventHandler("onClientRender", root, check) the same as addEventHandler("onClientRender", getRootElement(), check) cos when use root as an argument i dont get any errors O_O what is root? is it the same as getRootElement()? Link to comment
proracer Posted May 6, 2011 Share Posted May 6, 2011 Yes. https://wiki.multitheftauto.com/wiki/GetRootElement Note: all resources have a predefined global variable called root that has the root element as value. The variable exists server side as well as client side. It's for the people who are too lazy. Link to comment
qaisjp Posted May 6, 2011 Author Share Posted May 6, 2011 well yay ;D Also is there a way to make all resources have a defined global variable that has [xxx] as value? Link to comment
Castillo Posted May 6, 2011 Share Posted May 6, 2011 Yes.https://wiki.multitheftauto.com/wiki/GetRootElement Note: all resources have a predefined global variable called root that has the root element as value. The variable exists server side as well as client side. It's for the people who are too lazy. Strange, when i used "root" as getRootElement() it didn't worked (it was in an outputChatBox). Link to comment
Antibird Posted May 7, 2011 Share Posted May 7, 2011 Also is there a way to make all resources have a defined global variable that has [xxx] as value? Nope, resources can not share the same variable, each may have a variable "A = 1" for example, but changing it in any resource won't affect others, those are different variables just named similar. Call( ) is a basic way how resources communicate. 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