Jump to content

source, thePlayer, root, getRootElements?


kevin433

Recommended Posts

If you have a function that handles an event, the you can use source in that function, and source usually is what triggered the event.

You could read wiki too. But shortly: all players are peds, but all peds are not players. Variables like thePlayer, thePed, theWhatever are usually just examples on wiki, where they are just arguments for functions or defined earlier in the resource script, i.e localPayer = getLocalPlayer(), which sets player element as the value for that variable, and can be used only in client-side scripts as getLocalPlayer() is client-side only function.

All of these things that you asked about are or return element(s). You can find definition of MTA element here: https://wiki.multitheftauto.com/wiki/Element

Basically read through robhol tutorial: http://robhol.net/guide/basics/ (for some reason it requires some authentication at the moment :?: ). And then check the wiki examples.

Link to comment

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