Raised This Month: $476 Target: $400
 119% 

[CSS/CS:GO] Weapon Restrict


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Dr!fter
The Salt Boss
Join Date: Mar 2007
Plugin ID:
1200
Plugin Version:
3.1.6
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
    937 
    Plugin Description:
    Weapon restriction
    Old 10-02-2009 , 13:01   [CSS/CS:GO] Weapon Restrict
    Reply With Quote #1


    This is a weapon restrict plugin for CS:S it allows per player restrictions, ability to change the restrict sound and also comes with a warm up system! As of 3.0 it comes with a massive set of natives/forwards to be used by other plugins.

    THANKS:
    psychonic for answering all of my questions and convincing me to make cstrike extension better.
    cpnichol for helping test
    Snake60 for the awesome logo!

    Cvars:

    Example Weapon cvars (Will differ for CS:GO)
    Spoiler


    Warm up cvars
    Spoiler


    Other Cvars
    Spoiler


    Admin Commands
    Spoiler


    Dev Info (include file)
    Spoiler

    Install:

    Note 3.0 and up requires SDKHooks 2.1+ and SourceMod 1.5+

    Download the zip and extract the folder. Place the files in the server according to the path in the extracted folder.

    To install per map configs or per prefix configs they go in addons/sourcemod/configs/restrict
    mapname.cfg will be for maps and blah_.cfg for prefix it MUST have _ after the prefix (examples in the zip for test map and test prefix).

    Upgrading to 3.0:

    Upgrading from 2.3.X to 3.0 is mostly straight forward.
    Make sure to update weapon_restrict.cfg (in the cstrike/cfg/sourcemod folder) since there are new cvars.
    If you use a custom sound you now set it via cvar rather than the sound.txt file
    Per player has changed dramatically to allow all weapons rather than awp only. Overwrite the file and read the next post on how to set up per player.
    Requires SourceMod 1.4 and SDKHooks 2.1 or greater


    Change log:
    Spoiler


    3.0.5
    • Rewrote everything
    • Optimized everything
    • Added Natives
    • Reworked entire menu
    • Added group restrictions
    • Added translations for weapon names.
    • Added sm_restrict_knife_t and sm_restrict_knife_ct
    • Added check for weapon aliases
    • Improved method of checking buy/rebuy/autobuy (no longer removes and refunds)
    • Now doesnt remove the restricted weapon on pickup instead will not allow pickup
    • Change how sm_restrict and sm_unrestrict @all worked (now restricts knife aswell!)
    • Requires CS:S Weapon tools include for compiling (In the zip)
    • No longer uses gamedata
    • Added Forwards
    • Changed how restrict sound is set (now set via cvar sm_restricted_sound)
    • Added per player support for all weapons
    • Changed how per player worked (now has a default value and the last key found is set for the rest)
    • Added server command sm_perplayer_debug to help debug per player issues.
    • Added sm_allow_awp_pickup to block awp pickup even when allow restricted pickup is set to 1 (will block only if it will go above awp limit prevents the buy and drop and buy exploit on awps)
    • Added sm_perplayer_bots and sm_perplayer_specs to count bots/specs in per player counts
    • No longer requires downloading of sound file.
    • Adds support ammo cvars for grenades.

    3.0.6
    • Fixed bug with classnames not being all lowercase.
    • Fixed invalid id error
    • Fixed Special rounds lasting 2 rounds rather than 1.

    3.0.7
    • Fixed bug with unrestrict command when passing a team.
    • Fixed a bug when checking perplayer weapons.

    3.0.8
    • Fixed bug setting special rounds for after warmup.

    3.0.9
    • Fixed bug with weapon aliases.

    3.1.0 -> 3.1.4
    • Added support for CS:GO
    • Added better ID checks
    • Fixed bug with restricting knife
    • A bunch of CS:GO bugs

    3.1.5
    • Added support for workshop maps.
    • Removed deprecated functions.

    3.1.6
    • Fixed taser warmup not working.

    3.1.7
    • Fixed printing not showing color in CS:GO
    • Fixed respawning spectators.
    • Fixed compile warnings on SM 1.8+
    Note: all translations need to be updated to 3.0 translations


    Changes for 3.1.0 and up
    The config is now generated on start (it always was) but I wont include it in the zip anymore as guns differ from cs:s to cs:go. Install everything, start the server make sure weapon restrict loaded (sm plugins list). go to your <moddir>/cfg/sourcemod and edit weapon_restrict.cfg

    Requires SM 1.5!
    Attached Files
    File Type: zip weapon-restrict-3.1.7.zip (75.2 KB, 127 views)

    Last edited by Dr!fter; 04-19-2017 at 14:27.
    Dr!fter is offline
    Dr!fter
    The Salt Boss
    Join Date: Mar 2007
    Old 10-02-2009 , 13:04   Re: Weapon Restrict remake
    Reply With Quote #2

    Per player restrict:

    Per player restrict text file goes in sourcemod/configs/restrict/perplayerrestrict.txt
    (perplayerrestrict being the name of the text file used it will automaticly be placed when you extract the zip file from above)

    Inside the file should look something like this (by default).
    Code:
    "PerPlayer"
    {
    	"awp"
    	{
    		"default"		"0"
    		"10"			"1"
    		"18"			"2"
    	}
    	"usp"
    	{
    		"default"		"-1"
    		"18"			"0"
    	}
    	"flashbang"
    	{
    		"default"		"-1"
    		"20"			"10"
    	}
    	"defuser"
    	{
    		"default"		"-1"
    		"20"			"100"
    	}
    }
    the above perplayerrestrict file would do this.

    Between 0 and 17 usp will be restricted to -1
    Between 18 and 65 usp will be restricted to 0
    Between 0 and 9 awp will be restricted to 0
    Between 10 and 17 awp will be restricted to 1
    Between 18 and 65 awp will be restricted to 2
    Between 0 and 19 flashbang will be restricted to -1
    Between 20 and 65 flashbang will be restricted to 10
    Between 0 and 19 defuser will be restricted to -1
    Between 20 and 65 defuser will be restricted to 100

    For debug purposes the following server command was added sm_perplayer_debug and will print in the format above

    Pre/Post warmup configs:
    Pre and post warmup configs are located in addons/sourcemod/configs/restrict simply add cvar or commands you want to be run like you would do in a server config and done.

    Last edited by Dr!fter; 01-20-2012 at 17:35.
    Dr!fter is offline
    BDeep
    Senior Member
    Join Date: Jun 2009
    Location: NH
    Old 10-02-2009 , 13:11   Re: Weapon Restrict remake
    Reply With Quote #3

    +w00t

    I have been having all kinds of weird issues with the original. Looking forward to the things on the todo list.
    __________________
    BDeep is offline
    Dr!fter
    The Salt Boss
    Join Date: Mar 2007
    Old 10-02-2009 , 13:13   Re: Weapon Restrict remake
    Reply With Quote #4

    Yea i have the orginal with so many tweeks to it. But still dosnt work perfect. So i decided to make a new one.
    Dr!fter is offline
    Bigbuck
    Senior Member
    Join Date: Jul 2009
    Old 10-04-2009 , 10:06   Re: Weapon Restrict remake
    Reply With Quote #5

    We use Liam's version on our server and this seems like it will be a good improvement over it. I look forward to see your todo list completed.
    Bigbuck is offline
    Dr!fter
    The Salt Boss
    Join Date: Mar 2007
    Old 10-04-2009 , 11:33   Re: Weapon Restrict remake
    Reply With Quote #6

    Updated, fixed a few bugs and added the admin commands sm_knives, sm_pistols, sm_restrict, sm_unrestrict.
    Read the change log for a full list of changes
    Dr!fter is offline
    BeG
    Senior Member
    Join Date: Jan 2009
    Location: Germany
    Old 10-04-2009 , 16:16   Re: Weapon Restrict remake
    Reply With Quote #7

    iss the bug fixed when im buy an restrictet weapon that i dont become back my money?
    __________________
    !!!SRY FOR BAD ENGLISH!!!
    Our Clanhomepage:

    Visit Us!
    BeG is offline
    Dr!fter
    The Salt Boss
    Join Date: Mar 2007
    Old 10-04-2009 , 17:58   Re: Weapon Restrict remake
    Reply With Quote #8

    Quote:
    Originally Posted by BeG View Post
    iss the bug fixed when im buy an restrictet weapon that i dont become back my money?
    Yes.

    My next doing is optimization. Want to optimize before moving on. Which will most likely mean an entire rewrite.

    Last edited by Dr!fter; 10-04-2009 at 18:00.
    Dr!fter is offline
    Xp3r7
    SourceMod Donor
    Join Date: Jul 2006
    Old 10-04-2009 , 21:51   Re: Weapon Restrict remake
    Reply With Quote #9

    Very nice!

    I will probably switch over to this as more of the to-do list is complete!
    __________________
    Xp3r7 is offline
    Send a message via MSN to Xp3r7
    Dr!fter
    The Salt Boss
    Join Date: Mar 2007
    Old 10-12-2009 , 17:25   Re: Weapon Restrict remake
    Reply With Quote #10

    Little bit of an update. I rewrote some of the functions i will probably be releasing it sometime this week. Im just trying to add the map config to it in the next release.
    Dr!fter 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 16:45.


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