Mp buy allow guns: Difference between revisions
Jump to navigation
Jump to search
Tip: Armor, grenades, Defuse Kit, Rescue Kit, Zeus x27 and Riot Shield are not affected by this ConVar but instead there are other ConVars for them:
mNo edit summary |
m (Replacing {{console variable}}. This operation was performed by a bot.) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{this is a|console variable|name=mp_buy_allow_guns}} | |||
{{code|mp_buy_allow_guns}} determines the groups of weapons that [[player]]s are allowed to buy in the buy menu. | |||
{{Tip | Armor, grenades, [[item_defuser|Defuse Kit]], [[item_cutters|Rescue Kit]], [[weapon_taser|Zeus x27]] and [[weapon_shield|Riot Shield]] are not affected by this [[ConVar]] but instead there are other ConVars for them: | |||
* To restrict armor, use <code>'''mp_max_armor'''</code>. Set to 0 to disable all armor purchases, set to 1 to allow only [[item_kevlar|Kevlar]] or set to 2 to allow both Kevlar and [[item_assaultsuit|Kevlar + Helmet]]. As this ConVar affects only purchases, armor can still be equipped with {{ent|give}} or [[game_player_equip]] for example. | |||
{{ | * To restrict the grenade group, use <code>'''mp_buy_allow_grenades'''</code>. Set to 0 or 1 to disable or to enable the purchase of grenades. | ||
* To restrict the Zeus x27, use {{ent|mp_weapons_allow_zeus}}. | |||
* To restrict the Riot Shield, use {{ent|sv_shield_purchase_restricted_to}}. | |||
{{ | * To restrict any specific item(s), use {{ent|mp_items_prohibited}}. For example, to restrict Defuse Kits and Rescue Kits, use <code>mp_items_prohibited "55,56"</code>. | ||
}} | |||
== Syntax == | == Syntax == | ||
{{pre| | |||
mp_buy_allow_guns <int> | mp_buy_allow_guns <int> | ||
}} | |||
Its value is an integer from <code>0</code> to <code>255</code>, interpreted as a bitfield. Each of the eight bits (<code>1,2,4,8,16,32,64,128</code>) stands for a group of weapons that is either purchasable (<code>> 0</code>) or not (<code>= 0</code>). | Its value is an integer from <code>0</code> to <code>255</code>, interpreted as a bitfield. Each of the eight bits (<code>1,2,4,8,16,32,64,128</code>) stands for a group of weapons that is either purchasable (<code>> 0</code>) or not (<code>= 0</code>). | ||
Line 62: | Line 64: | ||
* The value <code>35 (= 1+2+32)</code> enables the purchase of pistols, SMGs and heavy weapons. Rifles, shotguns and sniper rifles are not purchasable. Equivalent to <code>99, 163</code> and <code>227</code>. | * The value <code>35 (= 1+2+32)</code> enables the purchase of pistols, SMGs and heavy weapons. Rifles, shotguns and sniper rifles are not purchasable. Equivalent to <code>99, 163</code> and <code>227</code>. | ||
* The value <code>0</code> disables the purchase of all of these weapon groups. Equivalent to <code>64, 128</code> and <code>192</code>. | * The value <code>0</code> disables the purchase of all of these weapon groups. Equivalent to <code>64, 128</code> and <code>192</code>. | ||
Latest revision as of 18:45, 7 January 2024
mp_buy_allow_guns
is a console variable available in all Source games.
mp_buy_allow_guns determines the groups of weapons that players are allowed to buy in the buy menu.

- To restrict armor, use
mp_max_armor
. Set to 0 to disable all armor purchases, set to 1 to allow only Kevlar or set to 2 to allow both Kevlar and Kevlar + Helmet. As this ConVar affects only purchases, armor can still be equipped with give or game_player_equip for example. - To restrict the grenade group, use
mp_buy_allow_grenades
. Set to 0 or 1 to disable or to enable the purchase of grenades. - To restrict the Zeus x27, use mp_weapons_allow_zeus.
- To restrict the Riot Shield, use sv_shield_purchase_restricted_to.
- To restrict any specific item(s), use mp_items_prohibited. For example, to restrict Defuse Kits and Rescue Kits, use
mp_items_prohibited "55,56"
.
Syntax
mp_buy_allow_guns <int>
Its value is an integer from 0
to 255
, interpreted as a bitfield. Each of the eight bits (1,2,4,8,16,32,64,128
) stands for a group of weapons that is either purchasable (> 0
) or not (= 0
).
Value | Weapon Type | Weapons |
---|---|---|
1 | Pistols | Glock-18 / P2000 / USP-S Dual Berettas P250 Tec-9 / CZ75-Auto / Five-SeveN Desert Eagle / R8 Revolver |
2 | SMGs | MAC-10 / MP9 MP7 / MP5-SD UMP-45 P90 PP-Bizon |
4 | Rifles | Galil AR / FAMAS AK-47 / M4A4 / M4A1-S SG 553 / AUG |
8 | Shotguns | Nova XM1014 Sawed-Off / MAG-7 |
16 | Sniper Rifles | SSG 08 AWP G3SG1 / SCAR-20 |
32 | Heavy | M249 Negev |
64 | - | - |
128 | - | - |
To disable only some of the groups, set this ConVar to 255
minus those groups' values.
To enable only some of the groups, set this ConVar to 0
plus those groups' values.
Adding or subtracting 64
or 128
makes no difference as those bits do not enable/disable anything.
Examples
- The value
255
enables the purchase of all weapons. It is the default value. Equivalent to63, 127
and191
. - The value
35 (= 1+2+32)
enables the purchase of pistols, SMGs and heavy weapons. Rifles, shotguns and sniper rifles are not purchasable. Equivalent to99, 163
and227
. - The value
0
disables the purchase of all of these weapon groups. Equivalent to64, 128
and192
.