๐Ÿ”ซ Framework Weapon Protection

The Framework Weapon Protection is a feature designed to be used with specific frameworks such as QB-Core or ESX. This protection ensures that weapon usage within these frameworks is legitimate by checking for discrepancies with weapon inventories. It supports QB-Inventory, ESX, and OX Inventory.

๐Ÿ› ๏ธ Configuration Overview

In your config.lua file, the framework weapon protection can be configured as follows:

-- Only Enable if you are using one of these
PrettyPacketAC.FrameworkWeaponProtection = {
    enabled = false,
    action = "WARN",
    framework = "qb",  
    inventory = "qb" -- qb (QB Inventory Newest Exports), ESX (Framework Functions), OX
}

-- Ignore if not using Framework Protection otherwise add in every weapon in your game to here both vanilla and Addon
PrettyPacketAC.FrameworkWeaponProtectionDict = {
    [GetHashKey("weapon_unarmed")] = {
        ["name"] = "weapon_unarmed"
    },
    [GetHashKey("weapon_knife")] = {
        ["name"] = "weapon_knife"
    },
}

๐Ÿ“ Recommendations for Setup

  • Enable Only If Using QB-Core/ESX: This feature should only be enabled if you are using QB-Core, ESX, or a compatible inventory system (e.g., OX Inventory). It relies on framework-specific functions to detect weapon discrepancies.

  • Populate Weapon Dictionary: To ensure reliable detection, youโ€™ll need to populate the FrameworkWeaponProtectionDict with the hash keys for every weapon in your game, both vanilla and addon weapons. This helps the protection system to accurately validate weapon ownership.


๐Ÿ”ง Weapon Dictionary Configuration

In the PrettyPacketAC.FrameworkWeaponProtectionDict, add each weapon you want to protect, like this:

PrettyPacketAC.FrameworkWeaponProtectionDict = {
    [GetHashKey("weapon_unarmed")] = {
        ["name"] = "weapon_unarmed"
    },
    [GetHashKey("weapon_knife")] = {
        ["name"] = "weapon_knife"
    },
    -- Add other weapons here
}

This allows PrettyPacketAC to cross-reference each weapon against the provided hash key and name. You can add both vanilla and addon weapons here for more thorough protection.

๐Ÿ’ก Pro Tip:

  • Framework-Specific Settings: Be sure to set the framework to either "qb" (for QB-Core), "esx" (for ESX), or "ox" (for OX Inventory) depending on the framework you are using. The inventory setting will depend on the specific inventory system you have installed.

  • Thorough Weapon List: For the best protection, ensure you list all weapons that are available on your server in the FrameworkWeaponProtectionDict. Missing weapons could lead to false flags or missed detections.

By implementing Framework Weapon Protection, youโ€™ll ensure that your server is protected against weapon-related cheats and exploits within QB-Core and ESX environments. Let us know if you need further assistance with setup! ๐Ÿ’–

Last updated