aclObjectGetGroups | Multi Theft Auto: Wiki Skip to content

aclObjectGetGroups

Client-side
Server-side
Shared

Added in 1.6.0 r22273

This function returns a table of all groups the object is in.

Syntax

table aclObjectGetGroups ( string theObject )
Required Arguments
  • theObject: The name of the ACL entry to get groups of.

Returns

  • table: groups list

Returns a table of all groups the object is in on success, false if something went wrong.

Code Examples

server

This example outputs a list of all groups of the calling user.

addCommandHandler("listGroups", function(player)
local account = getPlayerAccount(player)
if (not account or isGuestAccount(account)) then
return
end
outputChatBox('Groups:', player)
local groups = aclObjectGetGroups('user.'..getAccountName(account))
for _,v in ipairs(groups) do
outputChatBox('* '..aclGroupGetName(v), player)
end
end)