GetModuleInfo

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

This function returns information about the specified module.

Syntax

string getModuleInfo ( string moduleName, string information )

Required Arguments

  • moduleName: A string containing the module you wish to get information of e.g. "hashing.dll"
  • information: A string containing the information you wish to retrieve. Currently supported parametres are
    • Version
    • Name
    • Author

Returns

Returns a string with the requested information about the module. If invalid names for parameters are passed, it will return false.

Example

This example adds a command checkmodules with which you can view information about currently loaded modules.

function printModuleInfo ( thePlayer )
    local modules = getLoadedModules()
    if #modules == 0 then
        outputConsole ( "There are no modules loaded!", thePlayer )
    end

    for k, v in ipairs ( modules ) do
        local moduleName = getModuleInfo ( v, "Name" )
        local moduleVersion = getModuleInfo ( v, "Version" )
        local moduleAuthor = getModuleInfo ( v, "Author" )
        outputConsole ( moduleName .. "(" .. v .. ") v" .. moduleVersion .. ", author: " .. moduleAuthor, thePlayer )
    end
end
addCommandHandler ( "checkmodules", printModuleInfo )

See Also