JR10 Posted July 2, 2012 Posted July 2, 2012 Been wondering, is there a way to check if a function is deprecated? Something like: isFunctionDeprecated(getClientName) Thanks. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
JR10 Posted July 2, 2012 Author Posted July 2, 2012 Making a global functions list. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
50p Posted July 2, 2012 Posted July 2, 2012 Been wondering, is there a way to check if a function is deprecated?Something like: isFunctionDeprecated(getClientName) Thanks. No but you could make a function to check them. Since the functions are still present you would have to create a table with the list of functions then check if a function is in that table. If the functions were removed from MTA you could simply check "if not getClientName then" but the functions still exist. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
JR10 Posted July 2, 2012 Author Posted July 2, 2012 Thanks. But, I remember a script that gets you the globals list, and it would categorize the functions into deprecated, server only, client only, etc.. Just can't find it. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
MTA Team qaisjp Posted July 3, 2012 MTA Team Posted July 3, 2012 well you could loop _G, and check if the function is natively from lua or not. If not, then add it to the list. smth like this: local defaults = { ["_G"] = true, ["_VERSION"] = true, ["table"] = true, ["string"] = true, ["coroutine"] = true, ["pairs"] = true, ["ipairs"] = true } local fn = {} for i,v in pairs(_G) do if not defaults[i] then table.insert(fn, i) end end
50p Posted July 3, 2012 Posted July 3, 2012 well you could loop _G, and check if the function is natively from lua or not. If not, then add it to the list.smth like this: local defaults = { ["_G"] = true, ["_VERSION"] = true, ["table"] = true, ["string"] = true, ["coroutine"] = true, ["pairs"] = true, ["ipairs"] = true } local fn = {} for i,v in pairs(_G) do if not defaults[i] then table.insert(fn, i) end end Doesn't make sense. Think about MTA functions which are good. Check the meaning of "deprecated". @JR10, I haven't heard of such script but once you find it and it's available to public, please share it here so others could use it. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
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