aclGetGroup | Multi Theft Auto: Wiki Skip to content

aclGetGroup

Client-side
Server-side
Shared

This function is used to get the ACL group with the given name. If you need most of the groups you should consider using aclGroupList instead to get a table containing them all.

OOP Syntax Help! I don't understand this!

Syntax

aclgroup|false aclGetGroup ( string groupName )
Required Arguments
  • groupName: The name to get the ACL group from.

Returns

  • aclgroup|false: acl group

Returns the aclgroup if it could be found. Returns false/nil if it did not exist or failed for some reason.

Code Examples

server

This example makes every player able to use a command named giveAccountAdminRights that will add a specific accountname as an ACL object to the Admin group.

local function giveAdminRights (playerSource, commandName, accountName) --add the function giveAdminRights and specify its arguments
if (accountName) then --if there was an accountName entered then
aclGroupAddObject(aclGetGroup("Admin"), "user."..accountName)) --add an ACL object using the form "user.[accountName]" to the ACL group "Admin"
outputChatBox("Account '"..accountName.."' succesfully added to the admin group", playerSource) --output a notification to the player who entered the command that the acocunt was successfully added
else --else output an error message and the correct syntax of the command to the player who entered it
outputChatBox("No account name specified.", playerSource)
outputChatBox("Correct syntax: /giveAccountAdminRights [accountName]", playerSource)
end
end
addCommandHandler("giveAccountAdminRights", giveAdminRights) --add a command "giveAccountAdminRights" and attch the function "giveAdminRights" to it