Weapon Restrict

Weapon Restrict v3.1.7

No permission to download
Supported Games
CS: Source (v34), CS: Source (Steam/Orange Box), CS: GO
This plugin provides ability to restrict weapons, provides a warmup system on map start, per player restrict system and map based configurations.


556


Requirements :
  • Sourcemod v1.8 or Higher
Installation :
  • Download Weapon_Restrict.zip file attached to this post.
  • Extract the content of zip file and put into your server's cstrike folder.
  • Do the required configurations in config files.
  • Change the map or restart the server.
Configuration :

Warmup System :


You can enable/disable warmup on the map start. Warmup related CVARs are available in cstrike/cfg/sourcemod/weapon_restrict.cfg. To enable/disable warmup change the value of sm_warmup_enable CVAR. Additionally you can configure allowed weapons in warmup in cstrike/addons/sourcemod/configs/restrict/warmup.cfg.
There are 2 other cfg files, prewarmup.cfg and postwarmup.cfg. To do required things before the warmup for example changing gravity, speed etc, use prewarmup.cfg. To reset those settings and execute additional things, use postwarmup.cfg.

Map Based Configuration Files :

You can create map based cfg files and restrict/unrestrict certain weapons only for those maps. You can also use these cfg files for other tasks other than restricting weapons.
This plugin supports 2 ways for creating map based configuration files :
  • mapname.cfg: Create cfg using map names which handles tasks for only that map. Example : de_dust2.cfg, awp_lego_2.cfg etc
  • Prefix Based cfg: It supports prefix such as de_.cfg, cs_.cfg, awp_.cfg etc. In this case cfg will apply on all maps under used prefix.
Per Player Restrict :

You can restrict/unrestrict weapons based on number of players in the server. Per player based settings can be done in cstrike/addons/sourcemod/configs/restrict/perplayerrestrict.txt. It has default settings which looks something like below, you can change based on your needs :
Code:
"PerPlayer"
{
    "awp"
    {
        "default"       "0"
        "10"            "1"
        "18"            "2"
    }
    "usp"
    {
        "default"       "-1"
        "18"            "0"
    }
    "flashbang"
    {
        "default"       "-1"
        "20"            "10"
    }
    "defuser"
    {
        "default"       "-1"
        "20"            "100"
    }
}
Here is the illustration of what above settings will do (Max players assumed 64):
  • Between 0 and 17 players, usp will be restricted to -1
  • Between 18 and 65 players, usp will be restricted to 0
  • Between 0 and 9 players, awp will be restricted to 0
  • Between 10 and 17 players, awp will be restricted to 1
  • Between 18 and 65 players, awp will be restricted to 2
  • Between 0 and 19 players, flashbang will be restricted to -1
  • Between 20 and 65 players, flashbang will be restricted to 10
  • Between 0 and 19 players, defuser will be restricted to -1
  • Between 20 and 65 players, defuser will be restricted to 100
Admin Commands :
Code:
sm_dropc4                          -              Force drop the bomb from bomber.
sm_knives                          -              Sets up the next round as knife only round.
sm_pistols                         -              Sets up the next round as pistol only round.
sm_reload_restrictions             -              Reloads all weapons restrict CVARs and removes admin overrides.
sm_remove_restricted               -              Immediately removes all the restricted weapons from players to the amount it is set to.
sm_restrict                        -              Restricts a weapon or weapons
sm_unrestrict                      -              Unrestrict a weapon or weapons
Commands Usage :
CommandAdmin FlagUsageExample
!dropc4BAN!dropc4!dropc4
!knivesCONVAR!knives!knives
!pistolsCONVAR!pistols!pistols
!reload_restrictionsCONVAR!reload_restrictions!reload_restrictions
!remove_restrictedCONVAR!remove_restricted!remove_restricted
!restrictCONVAR!restrict <weapon|all|group> <amount> <both|ct|t>!restrict deagle 0
!restrict awp 2 ct
!restrict @all 1 t
!restrict grenades 0
!unrestrictCONVAR!unrestrict <weapon|all|group> <both|ct|t>!unrestrict deagle
!unrestrict awp ct
!unrestrict @all t
!unrestrict grenades

Server Commands :
Code:
sm_perplayer_debug                 -              Prints perplayer restrict configs to the server console.
CVARs :
// Set to 0 to allow awp pickup ONLY if it is under the max allowed. Set to 1 to use sm_allow_restricted_pickup method.
// -
// Default: "1"
sm_allow_awp_pickup "1"

// Set to 0 to ONLY allow pickup if under the max allowed. Set to 1 to allow restricted weapon pickup
// -
// Default: "0"
sm_allow_restricted_pickup "0"

// If enabled will count bots in per player restricts
// -
// Default: "1"
sm_perplayer_bots "1"

// If enabled will restrict awp per player count
// -
// Default: "0"
sm_perplayer_restrict "0"

// If enabled will count specs in per player restricts
// -
// Default: "1"
sm_perplayer_specs "1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:ak47
// -
// Default: "-1"
sm_restrict_ak47_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:ak47
// -
// Default: "-1"
sm_restrict_ak47_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:aug
// -
// Default: "-1"
sm_restrict_aug_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:aug
// -
// Default: "-1"
sm_restrict_aug_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:awp
// -
// Default: "-1"
sm_restrict_awp_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:awp
// -
// Default: "-1"
sm_restrict_awp_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:c4
// -
// Default: "-1"
sm_restrict_c4 "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:deagle
// -
// Default: "-1"
sm_restrict_deagle_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:deagle
// -
// Default: "-1"
sm_restrict_deagle_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:defuser
// -
// Default: "-1"
sm_restrict_defuser "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:elite
// -
// Default: "-1"
sm_restrict_elite_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:elite
// -
// Default: "-1"
sm_restrict_elite_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:famas
// -
// Default: "-1"
sm_restrict_famas_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:famas
// -
// Default: "-1"
sm_restrict_famas_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:fiveseven
// -
// Default: "-1"
sm_restrict_fiveseven_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:fiveseven
// -
// Default: "-1"
sm_restrict_fiveseven_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:flashbang
// -
// Default: "-1"
sm_restrict_flashbang_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:flashbang
// -
// Default: "-1"
sm_restrict_flashbang_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:g3sg1
// -
// Default: "-1"
sm_restrict_g3sg1_ct "0"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:g3sg1
// -
// Default: "-1"
sm_restrict_g3sg1_t "0"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:galil
// -
// Default: "-1"
sm_restrict_galil_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:galil
// -
// Default: "-1"
sm_restrict_galil_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:glock
// -
// Default: "-1"
sm_restrict_glock_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:glock
// -
// Default: "-1"
sm_restrict_glock_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:hegrenade
// -
// Default: "-1"
sm_restrict_hegrenade_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:hegrenade
// -
// Default: "-1"
sm_restrict_hegrenade_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:knife
// -
// Default: "-1"
sm_restrict_knife_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:knife
// -
// Default: "-1"
sm_restrict_knife_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:m249
// -
// Default: "-1"
sm_restrict_m249_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:m249
// -
// Default: "-1"
sm_restrict_m249_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:m3
// -
// Default: "-1"
sm_restrict_m3_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:m3
// -
// Default: "-1"
sm_restrict_m3_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:m4a1
// -
// Default: "-1"
sm_restrict_m4a1_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:m4a1
// -
// Default: "-1"
sm_restrict_m4a1_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:mac10
// -
// Default: "-1"
sm_restrict_mac10_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:mac10
// -
// Default: "-1"
sm_restrict_mac10_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:mp5navy
// -
// Default: "-1"
sm_restrict_mp5navy_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:mp5navy
// -
// Default: "-1"
sm_restrict_mp5navy_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:nvgs
// -
// Default: "-1"
sm_restrict_nvgs_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:nvgs
// -
// Default: "-1"
sm_restrict_nvgs_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon- P228
// -
// Default: "-1"
sm_restrict_p228_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon- P228
// -
// Default: "-1"
sm_restrict_p228_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon- P90
// -
// Default: "-1"
sm_restrict_p90_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon- P90
// -
// Default: "-1"
sm_restrict_p90_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:scout
// -
// Default: "-1"
sm_restrict_scout_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:scout
// -
// Default: "-1"
sm_restrict_scout_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:sg550
// -
// Default: "-1"
sm_restrict_sg550_ct "0"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:sg550
// -
// Default: "-1"
sm_restrict_sg550_t "0"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:sg552
// -
// Default: "-1"
sm_restrict_sg552_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:sg552
// -
// Default: "-1"
sm_restrict_sg552_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:smokegrenade
// -
// Default: "-1"
sm_restrict_smokegrenade_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:smokegrenade
// -
// Default: "-1"
sm_restrict_smokegrenade_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:tmp
// -
// Default: "-1"
sm_restrict_tmp_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:tmp
// -
// Default: "-1"
sm_restrict_tmp_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:ump45
// -
// Default: "-1"
sm_restrict_ump45_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:ump45
// -
// Default: "-1"
sm_restrict_ump45_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:usp
// -
// Default: "-1"
sm_restrict_usp_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:usp
// -
// Default: "-1"
sm_restrict_usp_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:vest
// -
// Default: "-1"
sm_restrict_vest_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:vest
// -
// Default: "-1"
sm_restrict_vest_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:vesthelm
// -
// Default: "-1"
sm_restrict_vesthelm_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:vesthelm
// -
// Default: "-1"
sm_restrict_vesthelm_t "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Counter-Terrorists. Weapon:xm1014
// -
// Default: "-1"
sm_restrict_xm1014_ct "-1"

// -1 = unrestricted, 0 = restricted, positive numbers = number allowed for Terrorists . Weapon:xm1014
// -
// Default: "-1"
sm_restrict_xm1014_t "-1"

// Sound to play when a weapon is restricted (leave blank to disable)
// -
// Default: "sound/buttons/weapon_cant_buy.wav"
sm_restricted_sound "sound/vertigo/weapon_restrict/restrictedweapon.wav"

// If 1 disables ff during warmup. If 0 leaves ff enabled
// -
// Default: "1"
sm_warmup_disable_ff "1"

// Enable warmup.
// -
// Default: "1"
sm_warmup_enable "0"

// Weather or not give infinite grenades if warmup weapon is grenades
// -
// Default: "1"
sm_warmup_infinite "1"

// Respawn players during warmup
// -
// Default: "1"
sm_warmup_respawn "1"

// Time after death before respawning player
// -
// Default: "0.5"
sm_warmup_respawn_time "0.5"

// How long in seconds warmup lasts
// -
// Default: "45"
sm_warmup_time "40"

// Enables admin immunity so admins can buy restricted weapons
// -
// Default: "0"
sm_weapon_restrict_immunity "0"

Credits :
  • Dr!fter
Author
Vertigo
Downloads
56
Views
1K
First release
Last update
Rating
5.00 star(s) 1 ratings

More resources from Vertigo

Share this resource

Latest reviews

Great, the Only things bothering me is that
There are 2 download files uploaded and both are the same files
Vertigo
Vertigo
Probably uploaded twice.
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock