Jump to content

Groot Element


Recommended Posts

  • MTA Team
Posted

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()?

  • MTA Team
Posted

well yay ;D

Also is there a way to make all resources have a defined global variable that has [xxx] as value?

Posted
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. :D

Strange, when i used "root" as getRootElement() it didn't worked (it was in an outputChatBox).

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...