# Weapons Manager & Restriction

{% hint style="danger" %}
⭐ This plugin is private! Can be purchased on our [Discord Marketplace](https://discord.com/invite/Tzmq98gwqF).
{% endhint %}

{% hint style="info" %}
This plugin is used to manage weapons and restrictions. The plugin contains extensive configuration for each individual weapon. For each weapon there can be different settings for each map, number of players and team, and also all settings are divided into VIP and NonVIP players.\ <br>

### ✨ The settings for each weapon include:

> All options are optional

1. `Global or Team Restriction`
   * Set weapon restriction
2. `Maximum Purcharses Per Map (Per player or per team)`
   * How many times a weapon can be purchased for a certain map
3. `Price`
   * Set custom weapon price
   * The price is not adjusted in the Buy menu
4. `Magazine Ammo`
   * How many bullets will be in the magazine
5. `Reserve Ammo`
   * How many bullets will be in the reserve
6. `Damage`
   * Weapon damage modification
7. `Headshot Multiplier`
   * Weapon headshot damage modification<br>

> All options are optional, if you don't set them, the default values ​​will always be used (Such as Price, Damage, etc..) Also, you don't need to use MapLimits at all (Or set them only for certain weapons), or you don't need to use Weapons Restrict at all, etc.. Check the configuration examples.

\
\- VIP Flag: <mark style="color:yellow;">**@wm/vip**</mark>
{% endhint %}

{% hint style="success" %}

### Global and Maps Settings

> For each weapon, you can set global settings (That it will work on all maps) or only on certain maps, and how to achieve this?

* If you want to set global settings, just put your settings in <mark style="color:red;">global.json</mark> (`plugins/WeaponManager/weapons_manager/global.json`)
* If you want to set the settings only on certain maps, just put your settings in <mark style="color:red;">MapName.json</mark> (`plugins/WeaponManager/weapons_manager/MapName.json`), for example: de\_mirage.json
  {% endhint %}

<details>

<summary>Language Preview</summary>

```
{
    "Chat.Prefix": "{darkred}[Weapons]{default}",
    "Chat.WeaponIsDisabled": "Weapon {green}{0}{default} is disabled!",
    "Chat.WeaponIsRestricted": "Weapon {green}{0}{default} is restricted! ({darkred}{1}{default})",
    "Chat.MaximumPurcharsesReached": "Weapon {green}{0}{default} can only be purchased {darkred}{1} times{default} per map!",
    "Chat.MaximumPurcharsesPerTeamReached": "Weapon {green}{0}{default} can only be purchased {darkred}{1} times{default} per map by your team!",
    "Chat.WeaponIsDisabledForYourTeam": "Weapon {green}{0}{default} is disabled for your team!"
}
```

</details>

### Config Examples

<details>

<summary>An example with all functions (Preview)</summary>

```json
{
    "weapon_awp": { // Weapon Name
        "MapLimits": {
            "PlayerMaxPurchasesPerMap_NonVIP": 3, // NonVIP player can purchase AWP only 3 times per map
            "PlayerMaxPurchasesPerMap_VIP": 5, // VIP player can purchase AWP only 5 times per map
            "TeamMaxPurchasesPerMap_NonVIP": {
                "CT": 10,
                "T": 10
            },
            "TeamMaxPurchasesPerMap_VIP": {
                "CT": 12,
                "T": 12
            }
        },
        "PlayersInTeamQuota": {
            "0": { // Calculated by players for each team 
                "NonVIP": {
                    "Disabled": false, // If the weapon is fully disabled for NonVIP players
                    "WeaponRestriction": {
                        "GlobalRestriction": false,
                        "CT": 3, //Only 3 players in the team will be allowed to have this weapon
                        "T": 3,
                        "Global": 0
                    },
                    "PrimaryAmmo": 8, //10 bullets will be in the magazine
                    "ReserveAmmo": 50, //50 bullets will be in the reserve
                    "Price": 5000, // The price for the purchase will be 5000
                    "Damage": 100,
                    "HeadshotMultiplier": 2.0
                },
                "VIP": {
                    "Disabled": false, // If the weapon is fully disabled for VIP players
                    "WeaponRestriction": {
                        "GlobalRestriction": false,
                        "CT": 4, //Only 4 players in the team will be allowed to have this weapon
                        "T": 4,
                        "Global": 0
                    },
                    "PrimaryAmmo": 10, //8 bullets will be in the magazine
                    "ReserveAmmo": 50, //50 bullets will be in the reserve
                    "Price": 4500, // The price for the purchase will be 4500
                    "Damage": 120,
                    "HeadshotMultiplier": 3.0
                }
            }
        }
    }
}
```

</details>

<details>

<summary>In this setting, <code>weapon_deagle</code> is disabled for VIP and NonVIP players if there are less than 6 or less players on the server. But if there are 32 and less players on the server (But more than 6), the weapon is enabled only for VIP players (For NonVIP it remains disabled)</summary>

```json
{
    "weapon_deagle": {
        "PlayersInTeamQuota": {
            "6": { 
                "NonVIP": {
                    "Disabled": true
                },
                "VIP": {
                    "Disabled": true
                }
            },
            "32": { 
                "NonVIP": {
                    "Disabled": true
                },
                "VIP": {
                    "Disabled": false
                }
            }
        }
    }
}
```

</details>

<details>

<summary>In this setting, <code>weapon_awp</code> is restricted. If there are 6 or less players on the server, the weapon is completely disabled. If there are 12 or less players on the server, the weapon is allowed 1x for each team (Always only one player in the team can have AWP). If there are 32 or less players on the server, the weapon is allowed for each team 2x (For VIP players 3x)</summary>

```json
{
    "weapon_awp": {
        "PlayersInTeamQuota": {
            "6": {
                "NonVIP": {
                    "Disabled": true
                },
                "VIP": {
                    "Disabled": true
                }
            },
            "12": {
                "NonVIP": {
                    "WeaponRestriction": {
                        "GlobalRestriction": false,
                        "CT": 1,
                        "T": 1,
                        "Global": 0
                    }
                },
                "VIP": {
                    "WeaponRestriction": {
                        "GlobalRestriction": false,
                        "CT": 1,
                        "T": 1,
                        "Global": 0
                    }
                }
            },
            "32": {
                "NonVIP": {
                    "WeaponRestriction": {
                        "GlobalRestriction": false,
                        "CT": 2,
                        "T": 2,
                        "Global": 0
                    }
                },
                "VIP": {
                    "WeaponRestriction": {
                        "GlobalRestriction": false,
                        "CT": 3,
                        "T": 3,
                        "Global": 0
                    }
                }
            }
        }
    }
}
```

</details>

<details>

<summary>In this setting, <code>weapon_g3sg1</code> and <code>weapon_scar20</code> (Auto Snipers) can only be purchased by an individual player 1x per map (VIP players 2x), but overall each team can only purchase it 4x per map.</summary>

```json
{
    "weapon_g3sg1": {
        "MapLimits": {
            "PlayerMaxPurchasesPerMap_NonVIP": 1,
            "PlayerMaxPurchasesPerMap_VIP": 2,
            "TeamMaxPurchasesPerMap_NonVIP": {
                "CT": 4,
                "T": 4
            },
            "TeamMaxPurchasesPerMap_VIP": {
                "CT": 4,
                "T": 4
            }
        }
    },
    "weapon_scar20": {
        "MapLimits": {
            "PlayerMaxPurchasesPerMap_NonVIP": 1,
            "PlayerMaxPurchasesPerMap_VIP": 2,
            "TeamMaxPurchasesPerMap_NonVIP": {
                "CT": 4,
                "T": 4
            },
            "TeamMaxPurchasesPerMap_VIP": {
                "CT": 4,
                "T": 4
            }
        }
    }
}
```

</details>

<details>

<summary>In this setting, <code>weapon_ak47</code> has its price adjusted. If there are 6 or less players on the server, the price will be $2500 for NonVIP players and $2300 for VIP players. If there are 32 or less players on the server, the price for NonVIP players will be $2700 and for VIP players $2500.</summary>

```json
{
    "weapon_ak47": {
        "PlayersInTeamQuota": {
            "6": {
                "NonVIP": {
                    "Price": 2500
                },
                "VIP": {
                    "Price": 2300
                }
            },
            "32": {
                "NonVIP": {
                    "Price": 2700
                },
                "VIP": {
                    "Price": 2500
                }
            }
        }
    }
}
```

</details>
