Mp buy allow guns: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "'''<code>mp_buy_allow_guns</code>''' is a console variable available in {{csgo}} Counter-Strike: Global Offensive. It determines the groups of weapons that players ca...")
 
mNo edit summary
Line 3: Line 3:
It determines the groups of weapons that [[player]]s can buy in the buy menu.
It determines the groups of weapons that [[player]]s can buy in the buy menu.


Syntax:
{{Note | Armor, grenades, [[weapon_taser|Zeus x27]],  [[item_defuser|Defuse Kit]] and [[item_cutters|Rescue Kit]] are not affected by this [[ConVar]].}}
{{Tip | To restrict armor, use {{ent|mp_max_armor}}.}}
{{Tip | To restrict the grenade group, use <code>mp_buy_allow_grenades 0</code>.}}
{{Tip | To restrict any specific item(s), use {{ent|mp_items_prohibited}}.}}
 
== Syntax ==
<source>
<source>
mp_buy_allow_guns <int>
mp_buy_allow_guns <int>
Line 9: Line 14:


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>).
{{Note | Armor, grenades, [[weapon_taser|Zeus x27]],  [[item_defuser|Defuse Kit]] and [[item_cutters|Rescue Kit]] are not affected by this [[ConVar]].}}
{{Tip | To restrict armor, use {{ent|mp_max_armor}}.}}
{{Tip | To restrict the grenade group, use <code>mp_buy_allow_grenades 0</code>.}}
{{Tip | To restrict any specific item(s), use {{ent|mp_items_prohibited}}.}}


{| class="standard-table"
{| class="standard-table"
|+ Weapon Groups
! Value
! Value
! Weapon Type
! Weapon Type
Line 53: Line 54:
|}
|}


To disable only some of the following groups, set this ConVar to <code>255</code> minus those groups' values.<br>
To disable only some of the groups, set this ConVar to <code>255</code> minus those groups' values.<br>
To enable only some of the following groups, set this ConVar to <code>0</code> plus those groups' values.<br>
To enable only some of the groups, set this ConVar to <code>0</code> plus those groups' values.<br>
Adding or subtracting <code>64</code> or <code>128</code> makes no difference as those bits do not enable/disable anything.
Adding or subtracting <code>64</code> or <code>128</code> makes no difference as those bits do not enable/disable anything.


Examples:
=== Examples ===
* The value <code>255</code> enables the purchase of all weapons. It is the default value. Equivalent to <code>63, 127</code> and <code>191</code>.
* The value <code>255</code> enables the purchase of all weapons. It is the default value. Equivalent to <code>63, 127</code> and <code>191</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, 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 weapons, with the above exceptions. Equivalent to <code>64, 128, 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>.


[[Category:Counter-Strike: Global Offensive]][[Category:Console Commands]]
[[Category:Counter-Strike: Global Offensive]][[Category:Console Commands]]

Revision as of 14:15, 2 April 2021

mp_buy_allow_guns is a console variable available in Counter-Strike: Global Offensive Counter-Strike: Global Offensive.

It determines the groups of weapons that players can buy in the buy menu.

Note.pngNote: Armor, grenades, Zeus x27, Defuse Kit and Rescue Kit are not affected by this ConVar.
Tip.pngTip: To restrict armor, use mp_max_armor.
Tip.pngTip: To restrict the grenade group, use mp_buy_allow_grenades 0.
Tip.pngTip: To restrict any specific item(s), use mp_items_prohibited.

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).

Weapon Groups
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 to 63, 127 and 191.
  • The value 35 (= 1+2+32) enables the purchase of pistols, SMGs and heavy weapons. Rifles, shotguns and sniper rifles are not purchasable. Equivalent to 99, 163 and 227.
  • The value 0 disables the purchase of all of these weapon groups. Equivalent to 64, 128 and 192.