Jump to content

Checking Deprecated Functions


JR10

Recommended Posts

Posted

Been wondering, is there a way to check if a function is deprecated?

Something like:

isFunctionDeprecated(getClientName) 

Thanks.

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

Posted

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
Posted

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 

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...