Raised This Month: $68 Target: $400
 17% 

[CS:S] Sniper Restrict


Post New Thread Reply   
 
Thread Tools Display Modes
Author
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Plugin ID:
2471
Plugin Version:
1.6.3.3
Plugin Category:
Fun Stuff
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Restrict players to X amount of frags with a sniper rifle (may include scouts if desired)
    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, 703 views)
    File Type: sp Get Plugin or Get Source (SniperRestrict.sp - 618 views - 30.6 KB)
    File Type: smx SniperRestrict.smx (18.7 KB, 582 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
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 08-04-2011 , 16:33   Re: [CS:S] Sniper Restrict
    Reply With Quote #2

    I will be changing this once Dr!fter releases v3 of the weapon_restrict plugin

    ...:: TnT Edit ::...
    The change will be to use his forwards - the concept will remain the same Unless he incorporates this plugins idea into his weapon_restrict plugin

    Last edited by TnTSCS; 08-12-2011 at 09:57.
    TnTSCS is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 08-12-2011 , 16:39   Re: [CS:S] Sniper Restrict
    Reply With Quote #3

    Updated to 1.2c

    Last thing I have to do is plug in a translation file
    TnTSCS is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 08-17-2011 , 14:20   Re: [CS:S] Sniper Restrict
    Reply With Quote #4

    Updated to 1.3

    Added setting to destroy weapon once MaxSniperKills limit is reached instead of just dropping the weapon. This was done be request so that another player can't pickup that weapon and use it. Set this option in the config file. If you update to 1.3, delete the old config file and let the plugin create a new one.
    TnTSCS is offline
    krzynek1
    Member
    Join Date: Jan 2009
    Old 10-30-2011 , 13:01   Re: [CS:S] Sniper Restrict
    Reply With Quote #5

    TnTSCS, can you make your plugin compatible with CSSDM ? Now it doesn't drop weapon neither destroy it.

    Last edited by krzynek1; 10-30-2011 at 14:05.
    krzynek1 is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 10-30-2011 , 14:04   Re: [CS:S] Sniper Restrict
    Reply With Quote #6

    So, when running this plugin with BAILOPAN's DeathMatch mod, the sniper weapon is not dropped or destroyed when the player reaches their max sniper limit?

    I'll have to look at the CSSDM and see how it handles weapons
    TnTSCS is offline
    krzynek1
    Member
    Join Date: Jan 2009
    Old 10-30-2011 , 14:04   Re: [CS:S] Sniper Restrict
    Reply With Quote #7

    yes, that's how it is now
    krzynek1 is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 10-30-2011 , 14:10   Re: [CS:S] Sniper Restrict
    Reply With Quote #8

    are there any errors in your logs? This plugin uses a gamedata file - make sure you have wpndrop-cstrike.games.txt in your sourcemod/gamedata folder
    TnTSCS is offline
    krzynek1
    Member
    Join Date: Jan 2009
    Old 10-30-2011 , 14:22   Re: [CS:S] Sniper Restrict
    Reply With Quote #9

    yes, there are error logs

    Code:
    L 10/30/2011 - 19:17:18: [SM] Native "SDKCall" reported: Invalid Handle 0 (error 4)
    L 10/30/2011 - 19:17:18: [SM] Displaying call stack trace for plugin "SniperRestrict.smx":
    L 10/30/2011 - 19:17:18: [SM]   [0]  Line 391, C:\srcdsdm\orangebox\cstrike\addons\sourcemod\scripting\SniperRestrict.sp::RestrictDropRepay()
    L 10/30/2011 - 19:17:18: [SM]   [1]  Line 230, C:\srcdsdm\orangebox\cstrike\addons\sourcemod\scripting\SniperRestrict.sp::Event_ItemPickup()
    my server info :

    Code:
    sm exts list
    [SM] Displaying 10 extensions:
    [01] Automatic Updater (1.3.8): Updates SourceMod gamedata files
    [02] Webternet (1.3.8): Extension for interacting with URLs
    [03] CS:S Tools (1.3.8): CS:S extended functionality
    [04] BinTools (1.3.8): Low-level C/C++ Calling API
    [05] Top Menus (1.3.8): Creates sorted nested menus
    [06] SDK Tools (1.3.8): Source SDK Tools
    [07] Client Preferences (1.3.8): Saves client preference settings
    [08] SQLite (1.3.8): SQLite Driver
    [09] CS:S DM (2.1.5-dev): Deathmatch for CS:S
    [10] SDK Hooks (2.1.0): Source SDK Hooks
    Code:
    sm version
     SourceMod Version Information:
        SourceMod Version: 1.3.8
        SourcePawn Engine: SourcePawn 1.1, jit-x86 (build 1.3.8)
        SourcePawn API: v1 = 4, v2 = 3
        Compiled on: Jun 25 2011 00:30:59
        Build ID: 3157:cf41e7301d55
        http://www.sourcemod.net/
    Code:
    meta version
    Metamod:Source version 1.8.7
    Build ID: 772:99b7a0a11fec
    Loaded As: Valve Server Plugin
    Compiled on: Jun 23 2011
    Plugin interface version: 15:14
    SourceHook version: 5:5
    http://www.metamodsource.net/
    configuration of sniper restrict

    Code:
    sm cvars 23
    [SM] Listing 8 convars for: Sniper Restrict
      [Name]                           [Value]
      sm_SniperRestrict_AdminNotify    1
      sm_SniperRestrict_DestroyWeapon  1
      sm_SniperRestrict_MaxSniperKill  2
      sm_SniperRestrict_ScoutIsSniper  0
      sm_SniperRestrict_SniperReplace  weapon_scout
      sm_SniperRestrict_sound          admin_plugin/actions/restrictedweapon.wav
      sm_SniperRestrict_version        1.3
      sm_SniperRestrict_version_build  1.3.8
    my plugin installation is correct, addon notifies me that I reached the limit but nothing happens

    Last edited by krzynek1; 10-30-2011 at 14:27.
    krzynek1 is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 10-30-2011 , 15:56   Re: [CS:S] Sniper Restrict
    Reply With Quote #10

    I'll look into it - it's strange though, on error, GetPlayerWeaponSlot should return -1 if no weapon in slot 0 (main weapon slot)

    http://docs.sourcemod.net/api/index....ad=show&id=37&

    which dev version of CSSDM do you have?
    cssdm-2.1.5-hg73-linux.tar.gz
    cssdm-2.1.5-hg73-mac.zip
    cssdm-2.1.5-hg73-windows.zip
    cssdm-2.1.5-hg75-linux.tar.gz
    cssdm-2.1.5-hg75-mac.zip
    cssdm-2.1.5-hg75-windows.zip
    cssdm-2.1.5-hg76-linux.tar.gz
    cssdm-2.1.5-hg76-mac.zip
    cssdm-2.1.5-hg76-windows.zip
    cssdm-2.1.5-hg77-linux.tar.gz
    cssdm-2.1.5-hg77-mac.zip
    cssdm-2.1.5-hg77-windows.zip

    Last edited by TnTSCS; 10-30-2011 at 15:57.
    TnTSCS is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 02:49.


    Powered by vBulletin®
    Copyright ©2000 - 2019, vBulletin Solutions, Inc.
    Theme made by Freecode