GetResources: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{Server function}}
{{Server function}}
__NOTOC__
__NOTOC__
{{Needs_Checking|Can't this be achieved with getElementsByType? --[[User:Talidan2|Talidan2]] 10:44, 29 August 2007 (CDT)}}
This function retrieves a table of all the resources that exist on the server.
This function retrieves a table of all the resources that exist on the server.



Revision as of 15:44, 29 August 2007


Dialog-information.png This article needs checking.

Reason(s): Can't this be achieved with getElementsByType? --Talidan2 10:44, 29 August 2007 (CDT)

This function retrieves a table of all the resources that exist on the server.

Syntax

table getResources ()

Returns

Returns a table of resources.

Example

This function lists all loaded resources in the console.

function displayResources()
     outputConsole("List of resources:")
     local resourceTable = getResources() -- get a table of resources
     for resourceKey, resourceValue in ipairs(resourceTable) do
          -- iterate through the table and output each resource's name
          local name = getResourceName(resourceValue)
          outputConsole(" " .. name)
     end
end

See Also