View Single Post
Author Message
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 09-07-2011 , 21:39   [CS:S+GO] RAWR : Red's Awp Wide Restriction (2.2=handling warmup)
Reply With Quote #1

RAWR : Red's AWP Wide Restriction

v. 2.2.0

Introduction/Features :

You think about putting AWPs on your server but you aren't fully sure ? Players complain that AWP is too strong when a certain person have it ? Then this plugin is for you.

This plugin is based on an AWP restriction plugin from EventScript (here for the ES-plugin link). In ES it was released only in French and seemed rather popular for French-only servers so I decided to remake it for sourcemod.

This plugin allows three kind of restrictions (as the ES version) :
  • Minimum players limit - Prevents people to use AWP if there is not enough players.
  • Team limit (the classic) - Only allows a certain number of AWPs to be used at a time in both teams.
  • Player/Individual limit - Prevents a player from always AWPing (i.e. AWP only 3 rounds in a row; then he needs to drop it during 3 rounds). Great to prevent good people from ruining other players gaming experience. There were no SM plugin doing this AFAIK (and this was the whole reason of this plugin).
  • As of 1.3.0, "Minimum players limit" (can) apply for the whole round, depending on if there was enough players at round start. I don't think there was a plugin doing such a thing before.
  • As of 2.0.0, you can share the restrictions rules between different weapons (i.e. restrict both AWP and g3sg1, but player can't use g3sg1 if he AWPed too much).

Known bugs :
  • None at the moment.

CVars :
  • redsawpwiderestrictionversion: Gives version -_-'
  • ----------
  • rawr : Is the plugin enabled ? 0=No, 1=Yes. Def. 1.
  • ----------
  • rawr_action_inbuyzone : What action to do with an restricted AWP in a buyzone (+ enough buytime) ? 0=strip, 1=drop, 2=refund. Def. 2.
  • rawr_action_outbuyzone : What action to do with an restricted AWP out of a buyzone (or not enough buytime) ? 0=strip, 1=drop. Def. 1.
  • rawr_action_respect16k : When refunding an AWP, respect 16k cash limit ? 0=No, 1=Yes. Def. 1.
  • ----------
  • rawr_minplayers : Minimum players in game required to buy AWPs. Def. 5.
  • rawr_minplayers_bothteams : Does both teams need to have the minimum players count to enable AWPs or should total player count be considered (i.e. 7v3 versus 5v5). 0=Total players, 1=Both teams. Def. 1.
  • rawr_minplayers_roundstart : When counting players (minplayers), do it at round start ? (If not it will be on buy/pickup) 0=No, 1=Yes. Def. 1.
  • ----------
  • rawr_teamlimit : Number of AWP allowed per team when rawr_minplayers is reached. Note that you may want to put rawr_teamlimit_additional to 0 for a fixed limit. 0=No maximum. Def. 1.
  • rawr_teamlimit_continuity : Who should get AWP if more there is more AWP than teamlimit CVar's value at round start (i.e. enemy AWPer changes team so a situation like 2awpVS0awp happen). 0=Least intensive AWPer, 1=Most intensive AWPer, 2=Most intensive AWPer (seconds based). Def. 2 (continuity prevail; recommended since someone AWPing will still be restricted).
  • rawr_teamlimit_additional : How many players are needed per additional AWP after the minimum amount of players has been reached. 0=Fixed limit. Default 10. New since 1.1.0.
  • ----------
  • rawr_playerlimit : How long (in round) can someone use an AWP. 0=disable 1+= number of rounds.
  • rawr_playerlimit_wait : How long (in round) before someone can someone re-use an AWP after having reached the limit of rounds. Min 1. Max 255. Def. 3.
  • rawr_playerlimit_recover : Does someone who doesn't touch an AWP during one round has his awp-use count reduced by 1 (doesn't count in 'wait' mode) ? 0=No, 1=Yes. Def. 0.
  • rawr_playerlimit_connect : How long (in round) should someone that joins for the first time on a map wait before being able to use a AWP ? Def. 0.
  • rawr_playerlimit_disconnect_use : Should a player awp-usage count be saved when he disconnect (to avoid reconnecting to bypass recovery/wait time; map change is excluded; elapse according to _recover) ? 0=No, 1=Yes. Def. 1. New since 2.1.0
  • rawr_playerlimit_disconnect_wait : Should a player wait time be saved when he disconnect (to avoid reconnecting to bypass wait time; map change is excluded) ? 0=No, 1=Yes (elapse, can wait disconnected), 2=Yes (doesn't elapse, the player must wait in-game). Def. 1. New since 2.1.0
  • ----------
  • rawr_verbose_prefix : Prefix attached to verboses' phrases. Default is '[SM]'.
  • rawr_verbose_reason : Tell the players why they're dropping an AWP. 0=No, 1=Yes. Def. 1.
  • rawr_verbose_onuse : Tell the players their AWP informations when they get one. 0=No, 1=Yes. Def. 1.
  • rawr_verbose_waitover : Tell the players when they can AWP due to recovery/waiting). 0=No, 1=Yes. Def. 1.
  • rawr_verbose_roundstart : Tell all the players when AWP change status (to disabled/enabled) at round start. 0=No, 1=Yes. Def. 1.
  • ----------
  • rawr_sound_buy : Sound to play when buying an AWP is denied (leave blank to disable; relative to 'sound/' folder). Default sound is in CSS, so no need to download it (you'll need to find an alternative for CSGO; apparently it should still work.
  • ----------
  • rawr_disable_prefixes : Disable the plugin with the following map prefixes. Use space (' ') as separator. Default is "awp_ fun_ aim_".
  • rawr_disable_warmup : Disable restrictions during warmup ? 0=No, 1=Yes. Def. 1. CSGO-only. New since 2.2.0
  • ----------New since 2.0.0----------
  • rawr_verbose_generic : Generic word used in the phrases; so you can put 'Snipe' and also restrict auto. Default 'AWP'.
  • rawr_restrict_weapons : Weapons to restrict. Separate with space (' '). Restriction is SHARED between weapons (no alternance possible). For example, "awp g3sg1 sg550 scar20" would restrict AWP and autos under both CSS and CSGO. Default "awp".
  • Note that the fact that the restriction shared, means that if someone i.e. AWP too much, he won't be able to use any of the restricted weapons.


Any suggestions/comments on the code or the plugin are welcomed and appreciated.

Changelog :
  • 1.0.0 Initial release. (07-09-2011)
  • Added missing "" gamedata file. (08-11-2011)
  • 1.0.1 Removed dependency for gamedata file. This is possible due to SM 1.4.0 built-in CSWeaponDrop gamedata under CS_DropWeapon function. This lighten the .sp and .smx a tiny bit. (23-02-2012)
  • 1.0.2 Added FCVAR_DONTRECORD flag. This means the config file the plugin creates won't contain the version number anymore. (24-02-2012)
  • 1.0.3 Fixed bug when buying an AWP and the user can't wear it; where you would get 11250 money. Thanks to "Ares Veteran" for reporting the bug (and giving a good way to reproduce the bug). (26-02-2012)
  • Added hungarian translation. Thanks to "Ares Veteran". (11-03-2012)
  • 1.0.4 (06-05-2012)
    • Corrected a bug where a player would see "You can now use AWPs" when another player would have quit so there wouldn't be enough players to awp.
    • Reworked the phrase to say that "The wait to use AWPs is over.", rather than the previous one (in the previous point) which would be dumb in scenario where not enough players would be present, making players not really able to awp. Therefore it is recommended that you redownload phrases.
    • Might have optimized something too (how expensive is operator[] in Pawn ?).
  • 1.1.0 (08-05-2012)
    • Added ConVar "rawr_teamlimit_additional". Default value is 10. This means that for every 10 players after the minimum amount of players is reached, an additional AWP will be unlocked (20, 30; not showing 10 since it's the minimum amount of players defined by "rawr_minplayers" and "rawr_minplayers_bothteams").
    • The amount of players needed for the next AWP is displayed when being denied buying a AWP. This means translations must be redownloaded. I also reworked them a little.
  • 1.1.0b Fixed version number (1.1.0 had 1.0.4 as version number; thanks to angel635 for reporting). (10-05-2012)
  • 1.1.1 Fixed bug with "rawr_minplayers_bothteams 1", where a player could buy an AWP if a team had enough player but not the other (&& --> || ). (15-05-2012)
  • 1.2.0 Plugin now prevent buying AWP when possible, rather than selling it back/dropping it. This makes people not lose their previous guns when buying an AWP. Also no more need for another plugin to do that -_-' (as I saw). (08-06-2012)
  • 1.3.0 is out (14-07-2012)
    • Remade default config so if not enough players are present on round start, then the "rawr_minplayers" restriction apply for the whole round. This prevent someone waiting in spawn to buy AWP, late joiner getting AWP while the fast-loader couldn't and people running back to spawn to buy an AWP because someone joined. New ConVar : "rawr_minplayers_roundstart".
    • When there is enough or not enough player, players will get notified (at the beginning of the round) on the AWP status (disabled --> enabled and vice-versa; but only on change, not every round). New ConVar : "rawr_verbose_roundstart".
    • Now default verbose tag has a space; and I removed the one in the verboses by default (all verboses could get bad indentation in chat if there was no plugin tag).
  • 1.4.0 Added option to play a sound when an awp's purchase is denied. (12-08-2012)
  • Reported to work in CS:GO. Thanks to karil. (24-08-2012)
  • 1.4.1 is out (28-10-2012)
    • Fixed some stuff for approval (based on Peace-Maker review; thought I believe I don't have to change his 3 last bullet points) :
      • Removed flag FCVAR_REPLICATED in version CVar.
      • Removed flag FCVAR_NOTIFY in non-version CVar.
      • Less duplicated code.
  • Approved by Peace-Maker. (28-10-2012)
  • 1.5.0 Added support for map prefixes. See ConVar rawr_disable_prefixes. (29-11-2012)
  • 2.0.0 (21-12-2012)
    • Added shared restriction. You can now restrict the same way multiple guns, and they will all be affected by the same waiting time and number of uses. See ConVar rawr_restrict_weapons
    • Since you can share restriction between multiple guns, the phrases were modified so you can use a generic word to designate all restricted guns. See ConVar rawr_verbose_generic
    • A good combination of those two ConVar would be "rawr_verbose_generic Snipe" with "rawr_restrict_weapons awp g3sg1 sg550 scar20". (scar20 is the CT auto of CSGO, and sg550 the CT auto of CSS)
    • Added german translation (thanks Miss.Xantis, and thanks/sorry micazoid).
  • 2.1.0 (17-05-2015)
    • Added disconnect support : see the console variables rawr_playerlimit_disconnect_use and rawr_playerlimit_disconnect_wait.
    • Changed default of rawr_playerlimit_connect to 0.
    • Added an upper bound limit to the console variable rawr_playerlimit_wait (255).
    • Fixed a possible message error that would happen when trying to strip an AWP that was corrupted (strange... ; reported by TUSK3N1337; couldn't reproduce though).
  • 2.2.0 Added the possibility to disable restriction during warmup. See ConVar rawr_disable_warmup. (02-07-2015)

How to install :
  • Place "redsawpwiderestriction.phrases.txt" in "translation" folder.
  • Place the plugin (redsawpwiderestriction.smx) in the plugin folder.
  • Place "" in "gamedata" folder. (had forgotten that until 08-11-2011 :$) Not needed anymore since 1.0.1 update.
  • As with many other plugins, a config file is automatically created in MOD\cfg\sourcemod\redsawpwiderestriction.cfg

Todo list :
Credits :
  • People from ES community for the idea ([email protected], patneze, DoCky and EmBouT).
  • TnTSCS : for bringing me the (07-11-2011)'s signature for drop-weapon function and making me realise I didn't upload any for this plugin. (for 1.0.0)
  • Ares Veteran : for bug reporting when you had over 11250 $ and buying an AWP would put you to 11250 $ if you couldn't use it (Fixed in 1.0.3). Also made hungarian translation.
  • Miss.Xantis : for german translation. Also if I wasn't a total retard I would have added it with micazoid version like 4 months ago (sorry micazoid :$).

Notes :
  • This plugin creates a config files in cfg/sourcemod automaticly.
  • If someone awps, disconnect and rejoin then re-awp in the same round; it will be counted as twice. This is a wanted behaviour.
  • 2.1.0 = 67 downloads
  • 2.0.0 = 536 .sp downloads, 715 .smx downloads (compiler didn't handle SDKHooks, hence 2 different numbers); 1.5.0old = 610 (old package)
  • ~pre 2.0 = 1357 .sp/.smx downloads, 829 translations downloads.
Attached Files
File Type: txt redsawpwiderestriction.phrases.txt (3.7 KB, 1431 views)
File Type: sp Get Plugin or Get Source (redsawpwiderestriction.sp - 1379 views - 39.1 KB)
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work

Last edited by RedSword; 07-02-2015 at 12:10. Reason: 2.2.0 is out
RedSword is offline