GetResourceExportedFunctions

From Multi Theft Auto: Wiki
Revision as of 12:56, 28 March 2008 by Arc (talk | contribs) (New page: __NOTOC__ {{Server function}} Returns a table containing the names of the functions that a resource exports. ==Syntax== <syntaxhighlight lang="lua"> table getResourceExportedFunctions ( resource res ) </c...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Returns a table containing the names of the functions that a resource exports.

Syntax

table getResourceExportedFunctions ( resource res )

Required Arguments

  • res: the resource of which you want to know the exported functions.

Returns

Returns a table of function names if successful, false otherwise.

Example

This simple example will output the names of the functions that the "scoreboard" resource exports.

local res = getResourceFromName ( "scoreboard" )
if res then
    local functionNames = getResourceExportedFunctions ( res )
    outputConsole ( "The scoreboard resource exports " .. #functionNames .. " functions:" )
    for i, name in ipairs ( functionNames ) do
        outputConsole ( name )
    end
else
    outputConsole ( "Unable to find the scoreboard resource. ")
end

See Also