How to restrict which guns can be bought in CS2
Type mp_buy_allow_guns 1 in the server console to allow only pistols. Add up pistols 1, SMGs 2, rifles 4, shotguns 8, snipers 16; 255 allows all.
mp_buy_allow_guns
Sets which gun categories can be bought, as a bitmask of weapon types.
mp_buy_allow_guns <bitmask> Examples
mp_buy_allow_guns 1 Pistols only.
mp_buy_allow_guns 5 Pistols and rifles (1 + 4).
mp_buy_allow_guns 0 No guns can be bought.
Arguments
bitmaskRequired- Sum of allowed categories: 1 pistols, 2 SMGs, 4 rifles, 8 shotguns, 16 snipers, 32 heavy.
What it does
Add up the numbers for the categories you want to allow: pistols 1, SMGs 2, rifles 4, shotguns 8, sniper rifles 16, heavy machine guns 32. 255 allows everything and 0 disables gun buying.
The game's own description: Whether players can purchase guns: pistols (1), SMGs (2), rifles (4), shotguns (8), sniper rifles (16), heavy MGs (32).
Run it on your server
On a SLASHPLAY server, type it in the Console tab of the server page; the reply shows right under it. A value set there lasts until the server restarts. To keep it, add the line to game/csgo/cfg/server.cfg. New to this? Start a CS2 server first.
Your own
CS2 server.
From $0.03 an hour, only while it runs. New accounts get 6 free tokens.