CrosRoad95 Posted April 7, 2017 Posted April 7, 2017 is possible to get all methods and variables from element? somethink like: vehicle:getMethods() print this page https://wiki.multitheftauto.com/wiki/Vehicle_class and other (define by user methods)
Addlibs Posted April 7, 2017 Posted April 7, 2017 (edited) since Vehicle is a lua table, you can for-loop it and you'll get all the functions as values, and function names as keys. local funcnames = {} --set up a table to store the names of the functions for k, v in pairs(Vehicle) do --loop all of the methods in Vehicle table if type(v) == "function" then --make sure this is a function, not a variable table.insert(funcnames, k) --add the function name to the new table end end local list = table.concat(funcnames, ", ") --concatenate all of the names in the table into a comma seperated list local truncated = list:sub(1,100) --truncated so it doesn't exceed chatbox message limit outputChatBox(truncated) Edited April 7, 2017 by MrTasty
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