View Single Post
Author Message
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 07-31-2011 , 22:21   [CS:S] Sniper Restrict
Reply With Quote #1

DESCRIPTION:
This plugin allows you to set a maximum number of kills a player can get using a sniper rifle. Sniper rifles are grouped together as AWPs and AUTOs - you can set the Scout as a sniper rifle if you want as well.

When a player reaches their maximum sniper frags, they will be forced to drop their sniper rifle and equiped with the weapon you specify in the config file. You can set the replacement to "none" if you don't want to give them any weapon when they reach their sniper frag limit. Just be sure to use primary weapon_names

The restriction for the player will remain in effect until the map changes or they disconnect and reconnect to your server.

This plugin is also compatible with CS:S DM

Changes in 1.6.1 add ability to turn off advertisement of plugin to joining players, ability to advise players via hint chat regarding sniper kills left and pending removal of sniper rifle (if you use Drop On Round End CVar).

New in 1.6.3.2 is a cooldown period where you can optionally set a number of rounds a player must wait before being allowed to use sniper weapons again after they've been restricted. No longer need the sound.txt, instead set the sound file you want to use with the new CVar (sm_SniperRestrict_sound which is defaulted to buttons/weapon_cant_buy.wav).

In-Game Commands:
sm_snipers (!snipers or /snipers if using default triggers)
- Will display the current status of the player's sniper kills

Overrides


CVars


REQUIREMENTS:
Sourcemod 1.4+
SMLib (if you want to recompile yourself)
Updater if you want to automatically receive updates to this plugin. BTW, leave the SMX in the root of PLUGINS folder until issue is resolved with Updater
SDKHooks

CREDITS:
dalto and RedSword for weapon drop stuff and gamedata file

Dr!fter and RedSword because I learned a lot looking at their plugins

berni for SMLib

GoD-Tony for Updater

I know there are probably more because I looked at a LOT of different code and started going crossed eyed

TO DO LIST:
DONE - Clean up code - there is a lot of redundance in it right now, but the plugin works good - tested it on a production server

DONE - Add code to check if they bought a restricted weapon and refund their money if they did (or block it entirely)

DONE - Add translation file so it's not hard coded in english. Update - still need to get to this

Maybe add a higher number of allowed sniper kills for those with reserved status (configurable flag and number of sniper kills)

Known Bugs:
FIXED - The sound doesn't download - I'll fix that this weekend - it works now, thanks to Dr!fters :)


You'll have to download the attached SniperRestrict.smx file because the web compiler won't compile the .sp file due to smlib and updater includes. Also, the zip files has the needed gamedata file and sound file and translation file.

INSTALLATION:
- Put SniperRestrict.smx in your addons/sourcemod/plugins folder
- Put wpndrop-cstrike.games.txt in your addons/sourcemod/gamedata folder
- put sound.txt in your cstrike\addons\sourcemod\configs\restrict folder
- Put restrictedweapon.wav in your sound/admin-plugin/actions folder (don't forget to put it on your fast download folder if you have a FastDL server)
- When you start up the plugin it will create a config file in cstrike/cfg/sourcemod folder called SniperRestrict.plugin.cfg - edit to your heart's content - just don't set ScoutIsSniper to 1 and set replacement weapon as the scout as well.
- If you change the sound file, make sure you put change the addons/sourcemod/configs/restrict/sound.txt file as well. Just take note that the sound file listed there is also with the weapon_restrict plugin.

Also in attachments is the old version just for historical purposes... Updated to include old files for 1.0 and 1.2c

CHANGE LOG


If you have 1.5.5 (or newer) and Updater, then the plugin already updated itself (or will soon).

As of 1.6.1, the CVar for updater is defaulted to off.

New CVars in 1.6.3.3, so either add them manually or backup the old config file (rename it to .old) and let the plugin create a new config file, then edit that one.
Attached Files
File Type: txt SniperRestrict.phrases.txt (2.5 KB, 1004 views)
File Type: sp Get Plugin or Get Source (SniperRestrict.sp - 898 views - 30.6 KB)
File Type: smx SniperRestrict.smx (18.7 KB, 967 views)
__________________
View my Plugins | Donate

Last edited by TnTSCS; 05-01-2013 at 10:29. Reason: Update from 1.6.3.2 to 1.6.3.3
TnTSCS is offline