ZH-CN/aclListRights

From Multi Theft Auto: Wiki
Revision as of 07:05, 6 February 2021 by Qwe7769611 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

此函数返回给定ACL拥有的所有权限的表.

语法

table aclListRights ( acl theACL, string allowedType )

OOP 语法 什么是OOP?

方法: acl:listRights(...)

必填参数

  • theACL: 要从中获取权限的ACL
  • allowedType: 允许的正确类型.可能的值为 general, function, resource and command

返回值

在给定ACL中以字符串形式返回权限上的表。这张表子可能是空的。如果acl无效或由于其他原因失败,则返回“false”或“nil”.

示例

本例输出给定acl的权限.(已测试!)

addCommandHandler("aclRights",function(player,command,theAcl)
	if(theAcl~="")then
		rights = aclListRights(aclGet(theAcl))
		count = 0
		for acl,list in pairs(rights)do
			outputChatBox("ACL List: "..theAcl.." #"..tostring(count).." Right: "..list..".",player)
			count = count + 1
		end
	else
		outputChatBox("Please type in a acl that you want to retrieve the rights from.",player)
		outputChatBox("Please use this Syntax: /aclRights theACL ",player)
	end
end)

See Also