GetResources: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(add oop syntax) |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | {{Server function}} | ||
__NOTOC__ | |||
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. | ||
Line 5: | Line 6: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
table getResources () | table getResources () | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[Resource]].getAll}} | |||
===Returns=== | ===Returns=== | ||
Returns a table of resources. | Returns a table of resources. | ||
==Example== | ==Example== | ||
This function lists all loaded resources in the console. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function displayResources() | function displayResources() | ||
outputConsole("List of resources:") | outputConsole("List of resources:") | ||
local resourceTable = getResources() -- get a table of resources | local resourceTable = getResources() -- get a table of resources | ||
for resourceKey, resourceValue in resourceTable do | for resourceKey, resourceValue in ipairs(resourceTable) do | ||
-- iterate through the table and output each resource's name | -- iterate through the table and output each resource's name | ||
local name = getResourceName(resourceValue) | local name = getResourceName(resourceValue) |
Latest revision as of 18:26, 24 June 2017
This function retrieves a table of all the resources that exist on the server.
Syntax
table getResources ()
OOP Syntax Help! I don't understand this!
- Method: Resource.getAll(...)
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
- abortRemoteRequest
- addResourceConfig
- addResourceMap
- call
- callRemote
- copyResource
- createResource
- deleteResource
- fetchRemote
- getRemoteRequestInfo
- getRemoteRequests
- getResourceACLRequests
- getResourceConfig
- getResourceDynamicElementRoot
- getResourceExportedFunctions
- getResourceFromName
- getResourceInfo
- getResourceLastStartTime
- getResourceLoadFailureReason
- getResourceLoadTime
- getResourceMapRootElement
- getResourceName
- getResourceOrganizationalPath
- getResourceRootElement
- getResources
- getResourceState
- getThisResource
- isResourceArchived
- isResourceProtected
- refreshResources
- removeResourceFile
- renameResource
- restartResource
- setResourceInfo
- startResource
- stopResource
- updateResourceACLRequest