MTA Team qaisjp Posted May 6, 2011 MTA Team 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()?
proracer Posted May 6, 2011 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.
MTA Team qaisjp Posted May 6, 2011 Author MTA Team 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?
Castillo Posted May 6, 2011 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).
Antibird Posted May 7, 2011 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.
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