getResources | Multi Theft Auto: Wiki Skip to content

getResources

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


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

OOP Syntax Help! I don't understand this!

Syntax

table getResources ( )

Returns

  • table: value

Returns a table of resources.

Code Examples

shared

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