aclGroupListObjects | Multi Theft Auto: Wiki Skip to content

aclGroupListObjects

Client-side
Server-side
Shared

This function returns a table over all the objects that exist in a given ACL group. These are objects like players and resources.

OOP Syntax Help! I don't understand this!

  • Method: aclgroup:listObjects(...)
  • Variable: .objects

Syntax

table|false aclGroupListObjects ( aclgroup theGroup )
Required Arguments
  • theGroup: The ACL group to get the objects from.

Returns

  • table|false: acl group objects list

Returns a table of strings 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.

Code Examples

server

This example outputs a list of objects if the ACL Group is given.

addCommandHandler("aclObjectList",function(player,command,aclGroup)
if (not aclGroup) then -- Was the group name provided?
outputChatBox("You must provide the group name!", player, 255, 255, 255)
return
end
local group = aclGetGroup(aclGroup)
if (group) then
local objects = aclGroupListObjects(group)
outputChatBox("List of objects in group "..aclGroup.." (#"..#objects..")", player, 255, 255, 255)
for k,v in ipairs(objects) do
outputChatBox("- "..v, player)
end
else
outputChatBox("Group with the name "..aclGroup.." does not exist.", player, 255, 255, 255)
end
end)