Use Weapon Restrictions

Requirements

 

Command Access

The easiest way to restrict weapons is to add amv_enable_beta "menu1" in adminmod.cfg. This allows you to use the command admin_restrictmenu in console and a menu (like the buy menu) appears in game for restricting weapons and items.

 

The standard method of using plugin commands from the console still works, if you want to enter restrictions manually in console or use the commands in a config file the syntax described in the next section.

Command Syntax

admin_restrict

admin_restrict [ <weapon-name> | <item-name> | menu [<menu-name>|<menu-number>] ]
admin_restrict [ team [ t | ct ] | player <player-id> ] (as above)
admin_restrict [ save | delete ] [ map | default ]
admin_restrict
admin_restrict [ help | on | off | restore | weapons | all ]

admin_unrestrict

admin_unrestrict [ <weapon-name> | <item-name> | menu [<menu-name>|<menu-number>] ]
admin_unrestrict [ team [ t | ct ] | player <player-id> ] (as above)
admin_unrestrict
admin_unrestrict [ help | weapons | all ]

 

The admin_unrestrict commmand uses the same basic syntax for adding or removing restrictions with the exception of the advanced management functions being unavailable. The effects of the arguments are identical except that they cause an unrestriction rather than a restriction. For example admin_unrestrict all will unrestrict everything.

 

 

Weapon and Item restriction

Weapon And Item Names

To restrict weapons and items the syntax is

admin_restrict [ <weapon-name> | <item-name> | menu [<menu-name>|<menu-number>] ]

The unrestriction syntax is identical. The weapon-name, item-name and menu-names will be explained below.

 

The list of weapon-names and item-names available for counter-strike is:

 

glock usp p228
deagle elites fn57
m3 xm1014 mac10
mp5 ump45 p90
tmp gallil ak47
scout sg552 awp
g3sg1 famas aug
m4a1 sg550 m249
vest vesthelm flash
hegren sgren defuser
nvgs shield

 

The new names for some weapons can also be used. The table below complements the table above, an empty cell means that there is no alternative name to the name above, an entry in the table below can be used in place of the entry in the same position in the table above. For example glock can also be known as 9x19mm but there is no other name for elites.

 

9x19mm km45 229compact
nighthawk   fiveseven
12gauge autoshotgun  
smg   c90
mp defender cv47
  krieg552 magnum
d3au1 clarion bullup
  krieg550  
     
     
   

 

As well as being able to restrict individual weapons and items it is possible to restrict them in menu-names using their menu positions. These menu-name names can be used in place of weapon-name or item-name. Each menu menu-name also has a number, these numbers are the menu-name menu entry number. You can use the number instead of the menu-name name when restricting or unrestricting the menu-name.

 

The menu-name names and numbers available as as follows:

Name (<menu-name>)Number (<menu-number>)
pistols1
shotguns2
smg3
rifles4
machine guns5
equipment8

 

for example if you wanted to restrict all rifles you could either use the command admin_restrict menu rifles or admin_restrict menu 4. Both will restrict all rifles. Similarly if you wish to unrestrict all rifle usage you could use admin_unrestrict menu 4 or admin_unrestrict menu rifles.

 

Examples

This command will prevent all users from using the 12gauge shotgun.
admin_restrict 12gauge

 

The following commands will restrict all rifles for the duration of the current map only
admin_restrict menu rifles
admin_restrict menu 4

 

This command will save the current restrictions as the default restrictions on the server
admin_restrict save default

 

this command will prevent the user whos name is A User from using the mac10 rifle.
admin_restrict player "A User" mac10

 

this command will prevent all terrorists from using the awp rifle.
admin_restrict team t awp