ZH-CN/AclGroupList

From Multi Theft Auto: Wiki
Revision as of 06:38, 6 February 2021 by Qwe7769611 (talk | contribs) (Created page with "__NOTOC__ {{Server function}} 此函数返回所有ACL组的表. ==语法== <syntaxhighlight lang="lua"> table aclGroupList () </syntaxhighlight> {{OOP_ZH-CN|This functio...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

此函数返回所有ACL组的表.

语法

table aclGroupList ()

OOP 语法 什么是OOP?

提示: This function is a static function underneath the ACL Group class.
方法: ACLGroup.list(...)

Returns

如果成功,则返回所有ACL组的表;如果不存在ACL组,则返回空表.如果此函数因其他原因失败,则可以返回"false"/"nil".

示例

此示例显示如何按“showAclGroups”输出所有ACL组名

function showGroups(player)
	local groups = {}
	groups = aclGroupList()
	for i,v in ipairs(groups) do
		local name = aclGroupGetName(v)
		outputChatBox(tostring(name),player)
	end
end
addCommandHandler("showAclGroups",showGroups)

See Also