Custom Permissions (ACE)

This page describe how to implement custom permissions that applys fiveguard perms to player

Alternative Permissions must be disabled in config to make this work

-- Server-Side

ExecuteCommand("add_ace group.bypassPermGroup command allow")
ExecuteCommand("add_principal resource." .. GetCurrentResourceName() .. " group.bypassPermGroup")

local permissionsGroups = { -- Permissions that'll be set to true for specific player
    admin = {
        --[[ AdminMenu ]]  --
        "AdminMenuAccess",
        "AnnouncementAccess",
        "ESPAccess",
        "ClearEntitiesAccess",
        "BanAndKickAccess",
        "GotoAndBringAccess",
        "VehicleAccess",
        "MiscAccess",
        "LogsAccess",
        "PlayerSelectorAccess",
        "BanListAndUnbanAccess",
        "ModelChangerAccess",
        --[[ Client ]] --
        "BypassSpectate",
        "BypassGodMode",
        "BypassInvisible",
        "BypassStealOutfit",
        "BypassInfStamina",
        "BypassNoclip",
        "BypassSuperJump",
        "BypassFreecam",
        "BypassSpeedHack",
        "BypassTeleport",
        "BypassNightVision",
        "BypassThermalVision",
        "BypassOCR",
        "BypassNuiDevtools",
        "BypassBlacklistedTextures",
        "BlipsBypass",
        "BypassCbScanner",
        --[[ Weapon ]] --
        "BypassWeaponDmgModifier",
        "BypassInfAmmo",
        "BypassNoReload",
        "BypassRapidFire",
        --[[ Vehicle ]] --
        "BypassVehicleFixAndGodMode",
        "BypassVehicleHandlingEdit",
        "BypassVehicleModifier",
        "BypassBulletproofTires",
        --[[ Blacklist ]] --
        "BypassModelChanger",
        "BypassWeaponBlacklist",
        --[[ Misc ]] --
        "FGCommands",
        "BypassVPN",
        "BypassExplosion",
        "BypassClearTasks",
        "BypassParticle"
    },
    supporter = {
        "BypassSpectate"
    }
}

for groupName, permissionsObject in pairs(permissionsGroups) do
    for _, permissionValue in ipairs(permissionsObject) do
        ExecuteCommand("add_ace group." .. groupName .. "_FgGroup " .. permissionValue .. " allow")
    end
end

-- this event must be triggered before player is loaded to server, for example on player joining event, your code should handle permission setup and run the command "add_principal" to assign ACE group to player identifier
AddEventHandler("yourEventToHandlePermissions", function(playerId, group)
    ExecuteCommand("add_principal identifier." .. GetPlayerIdentifier(playerId, 0) .. " group." .. group .. "_FGGroup")
end)

Last updated