GetResourceACLRequests: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{server function}} This function retrieves the ACL request section from the meta.xml file of the given resource. ==Syntax== <syntaxhighlight lang="lua"> table getResourceACLReques...")
 
No edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{server function}}
{{server function}}
{{New feature/item|3.0120|1.2||
Only available in MTA:SA 1.2 and onwards.
}}
This function retrieves the ACL request section from the meta.xml file of the given resource.
This function retrieves the ACL request section from the meta.xml file of the given resource.
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">

Revision as of 02:27, 7 December 2011

Only available in MTA:SA 1.2 and onwards. This function retrieves the ACL request section from the meta.xml file of the given resource.

Syntax

table getResourceACLRequests ( resource theResource ) 

Required Arguments

  • theResource: the resource to get the ACL requests for.

Returns

Returns a table with the ACL requests for the given resource, or false if the resource is not valid. A valid resource with no ACL requests will return an empty table.

Example

This function lists ACL requests from all resources in the client console.

function showAllACLRequests()
  for _,resource in ipairs(getResources()) do
    local requests = getResourceACLRequests (resource)
    if #requests > 0 then
      outputConsole( getResourceName(resource).." has "..#requests.." ACL request(s)" )
      for i,request in ipairs(requests) do
        outputConsole( tostring(i)
                 .. "  name:" .. request.name
                 .. "  access:" .. tostring(request.access)
                 .. "  pending:" .. tostring(request.pending)
                 .. "  who:" .. request.who
                 .. "  date:" .. request.date
               )
      end
    end
  end
end

Requirements

Minimum server version 1.2
Minimum client version n/a

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version server="1.2" />

See Also