GetLoadedModules: Difference between revisions
Jump to navigation
Jump to search
m (→Example) |
No edit summary |
||
Line 22: | Line 22: | ||
if #modules == 0 then | if #modules == 0 then | ||
outputServerLog("No modules are loaded!") | return outputServerLog("No modules are loaded!") | ||
end | |||
for k,v in ipairs(modules) do | |||
outputServerLog( v ) | |||
end | |||
outputServerLog("Loaded " .. #modules .. " modules in total.") | |||
end | end | ||
addCommandHandler("modules", checkModules) | addCommandHandler("modules", checkModules) |
Revision as of 05:46, 20 May 2009
This function returns all the currently loaded modules of the server.
Syntax
table getLoadedModules ()
Returns
Returns a table of all the currently loaded modules. If no modules are loaded, the table will be empty.
Example
Adds a command that lists all loaded modules in the server log.
function checkModules() local modules = getLoadedModules() if #modules == 0 then return outputServerLog("No modules are loaded!") end for k,v in ipairs(modules) do outputServerLog( v ) end outputServerLog("Loaded " .. #modules .. " modules in total.") end addCommandHandler("modules", checkModules)
See Also