ZH-CN/AclGroupList: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Server function}} 此函数返回所有ACL组的表. ==语法== <syntaxhighlight lang="lua"> table aclGroupList () </syntaxhighlight> {{OOP_ZH-CN|This functio...")
 
mNo edit summary
 
Line 30: Line 30:
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc -->
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc -->
{{ACL_functions}}
{{ACL_functions}}
[[ar:aclGroupList]]
[[en:AclGroupList]]
[[en:AclGroupList]]
[[zh-cn:AclGroupList]]

Latest revision as of 18:30, 21 February 2021

此函数返回所有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