ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. isObjectInACLGroup

Function

isObjectInACLGroup

ServerPermissions (ACL)Identical to MTA:SA

Checks whether an object belongs to a permission group (created by script or from the admins.xml levels).

Syntax

bool isObjectInACLGroup(mixed theObject, aclgroup theGroup)

Arguments

theObjectmixed
A player, resource or the string "user.name".
theGroupaclgroup
The group.

Returns

true if it belongs.

Example

addCommandHandler("heal", function(player, cmd, name)
    if not isObjectInACLGroup(player, aclGetGroup("Admin")) then
        outputChatBox("Brak uprawnień.", player, 255, 0, 0)
        return
    end
    local target = getPlayerFromName(name or "") or player
    setElementHealth(target, 100)
end)

See also