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