AclGroupListACL: Difference between revisions

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


==Example==  
==Example==  
This example outputs the list of ACL's if the aclGroup name is given.
This example outputs the list of ACL's if the aclGroup name is given. (TESTED!)
<syntaxhighlight lang="lua">addCommandHandler("aclList",function(player,command,aclGroup)
<syntaxhighlight lang="lua">addCommandHandler("aclList",function(player,command,aclGroup)
if(aclGroup~="")then
if(aclGroup~="")then
table = aclGroupListACL(aclGetGroup(tostring(aclGroup)))
tables = aclGroupListACL(aclGetGroup(aclGroup))
count = 0
count = 0
for list,name in ipairs(#table)do
for list,nam in pairs(tables) do
outputChatBox("ACL LIST: "..aclGroup.."Line: "..tostring(count).." ACL: "..name..".",player)
outputChatBox("ACL LIST: "..aclGroup.."Line: "..tostring(count).." ACL: "..aclGetName(nam)..".",player)
count = count + 1
count = count + 1
end
end

Revision as of 20:56, 27 April 2012

This function returns a table over all the ACL's that exist in a given ACL group.

Syntax

table of acl aclGroupListACL ( aclgroup theGroup )

Required Arguments

  • theGroup: The ACL group to get the ACL elements from

Returns

Returns a table over the ACL elements in the given ACL group. This table might be empty. Returns false or nil if theGroup is invalid or it fails for some other reason.

Example

This example outputs the list of ACL's if the aclGroup name is given. (TESTED!)

addCommandHandler("aclList",function(player,command,aclGroup)
	if(aclGroup~="")then
		tables = aclGroupListACL(aclGetGroup(aclGroup))
		count = 0
		for list,nam in pairs(tables) do
			outputChatBox("ACL LIST: "..aclGroup.."Line: "..tostring(count).." ACL: "..aclGetName(nam)..".",player)
			count = count + 1
		end
	else
		outputChatBox("Please add the aclGroup you want the list of.",player)
		outputChatBox("Syntax: /aclList aclGroup",player)
	end
end)

See Also