ZeroTrust
ZeroTrust
ZeroTrust
  • Welcome
  • Getting Started
    • Installing the Anti-Cheat
      • Installing for Standalone
      • Installing for ESX
      • Installing for QBCore
      • Installing for vRP
  • Commands
    • Ban players
    • Unban players
    • Re-ban unbanned players
    • Ban infos
    • Cross-servers bans
    • Delete players entities
    • Delete all entities
    • Blacklist IP
    • Ignoring bans
  • Safe Modes
    • Only Kick
    • Only Logs
  • Web Panel
    • Soon
Powered by GitBook
On this page
  1. Getting Started
  2. Installing the Anti-Cheat

Installing for vRP

To integrate ZeroTrust with an vRP-based server, you'll need to replace the function Cfg.GetAdminGroup inside config_s.lua with the following code to ensure proper compatibility:

local Proxy = module("vrp", "lib/Proxy")
local vRP = Proxy.getInterface("vRP")

Cfg.WhitelistedGroups = { -- If you have created or edited any group, add it here
    god = true,
    admin = true,
    superadmin = true
}

Cfg.GetAdminGroup = function(source)
    if not source then return nil end

    local user_id = vRP.getUserId(source)
    if not user_id then return nil end

    local groups = vRP.getUserGroups(user_id)
    local whitelist = Cfg.WhitelistedGroups

    for group_name in pairs(groups) do
        if whitelist[group_name] then
            return group_name
        end
    end

    return nil
end

This function ensures that ZeroTrust correctly retrieves the player's admin group, allowing it to recognize different permission levels (e.g., "god") within your vRP framework. You can check your vrp/cfg/groups.lua file and search cfg.groups to see if there are differents groups, if so, add them to the Cfg.WhitelistedGroups

Make sure you have vRP installed and properly configured before making these changes.

ZeroTrust caches the result of Cfg.GetAdminGroup after the first use per player. This ensures that each player's admin group is checked only once, minimizing unnecessary calls and avoiding potential spam.

PreviousInstalling for QBCoreNextBan players

Last updated 3 days ago

Groups are taken from the official vRP github :

https://github.com/vRP-framework/vRP/blob/master/vrp/cfg/groups.lua