Kenix Posted January 28, 2012 Share Posted January 28, 2012 (edited) Lua predefined variables. _G -- returns a table of all global variables coroutine -- returns a table containing functions for threads debug -- returns a table containing debug functions. math -- returns a table that contains mathematical functions. string -- returns a table containing functions for strings table -- returns a table that contains functions for tables _VERSION -- returns a string of the version of lua in format "Lua 5.1" self -- used in methods. MTA predefined variables. Shared exports -- returns a table of resource names containing all export functions resource -- returns a resource element of the resource the snippet was executed in resourceRoot -- returns a resource root element of the resource the snippet was executed in root -- returns the all elements Client only guiRoot -- returns the root element all GUI elements. localPlayer -- returns the player element of the local player. List hidden local variables, that can be in functions-handlers: Shared source -- The player or element the event was attached to this -- Element, which was attached function-handler. eventName -- the name of the event ("onResourceStart", "onPlayerWasted" etc.) Server only client -- the client that called the event sourceResourceRoot -- the root of the resource that called the event sourceResource -- the resource that called the event List create user Fro, More details on the functios-handlers Element tree If list is broken or change - write down update list and this post will be updated. Original post by MX_Master viewtopic.php?f=141&t=37420 Wiki: https://wiki.multitheftauto.com/wiki/Pre ... ables_list Edited March 18, 2012 by Guest 2 Link to comment
12p Posted January 29, 2012 Share Posted January 29, 2012 I think the name should be "predefined variables", not "global variables". But this is a very nice info. 1 Link to comment
Kenix Posted January 29, 2012 Author Share Posted January 29, 2012 (edited) Updated. Edited May 23, 2013 by Guest Link to comment
Jaysds1 Posted January 29, 2012 Share Posted January 29, 2012 Thanks for the list of variables, it is very useful for us scripters Link to comment
RottenFlesh Posted February 3, 2012 Share Posted February 3, 2012 Thanks for the info Link to comment
eAi Posted February 6, 2012 Share Posted February 6, 2012 Shouldn't this be on the wiki? Link to comment
Kenix Posted February 6, 2012 Author Share Posted February 6, 2012 (edited) Shouldn't this be on the wiki? Yes, you right. Added to wiki https://wiki.multitheftauto.com/wiki/Pre ... ables_list Created link in Introduction to Scripting. https://wiki.multitheftauto.com/wiki/Scr ... troduction Edited May 12, 2012 by Guest Link to comment
qaisjp Posted February 11, 2012 Share Posted February 11, 2012 I updated both wiki pages slightly Scripting Introduction and Predefined variables list Link to comment
Kenix Posted February 11, 2012 Author Share Posted February 11, 2012 I updated both wiki pages slightlyScripting Introduction and Predefined variables list Thank you Link to comment
Aibo Posted March 8, 2012 Share Posted March 8, 2012 1. imo, it's better to have just the 2 lists: server/client. this 4-part-shared idea is overcomplicated. 2. what about "self" in methods? also, i believe there should be some indication, which vars belong to Lua and which introduced by MTA. Link to comment
Kenix Posted March 8, 2012 Author Share Posted March 8, 2012 (edited) Updated. 1. imo, it's better to have just the 2 lists: server/client. this 4-part-shared idea is overcomplicated. I think better don't change. Edited October 27, 2012 by Guest Link to comment
RaceXtreme Posted January 7, 2013 Share Posted January 7, 2013 Nice, thank you for the information. You also remember me to update my language Wiki ^^ Link to comment
DanielleShriek Posted May 13, 2013 Share Posted May 13, 2013 Amazing write up!! List of predefined variables are flabbergast..Would like to thanks for imparting this with us. Link to comment
Kenix Posted May 13, 2013 Author Share Posted May 13, 2013 This is an old topic -.-" and ? Link to comment
PaiN^ Posted May 13, 2013 Share Posted May 13, 2013 What's the point of replaying to it ? Link to comment
tosfera Posted August 15, 2013 Share Posted August 15, 2013 Alot of people dont know the types of variables. Maybe you could add some of them? Alsoa dd the tostring etc, people dont know what it does, if you're able to use it etc? (People without any programmings knowledge or web dev's in html/php dont know the tostring, tonumber, int, string, double, float etc) 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