kevin433 Posted February 16, 2010 Posted February 16, 2010 Hi, I scripted in SA:MP, but it got boring, because you can't do much things there. However, I started yesterday with MTA scripting. One thing I have wondered about is source, thePlayer, thePed, getRootElements etc... I would like to know when and where i should use them.
madis Posted February 16, 2010 Posted February 16, 2010 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.
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