Monthly Target: $400 Donations: $131
 32% 

[CS:S/CS:GO] CT Bans


Post New Thread Reply   
 
Thread Tools Display Modes
Author
databomb
Veteran Member
Join Date: Jun 2009
Location: Boston, MA
Plugin ID:
2527
Plugin Version:
1.6.1.3
Plugin Category:
Admin Commands
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
    17 
    Plugin Description:
    Allows admins to restrict access to the CT team from those who violate the server's rules.
    Old 08-30-2011 , 12:36   [CS:S/CS:GO] CT Bans
    Reply With Quote #1

    [CS:S] CT Bans
    by: databomb

    Description:

    Allows admins to restrict access to the CT team from those who violate the server's rules. There are already two plugins posted that I'm aware of for this. Mr. Zero's Team Restrict plugin which has basic command functionality but doesn't save the data past a map change/disconnect. Azelphur's TeamBans plugin also uses ClientPrefs but doesn't allow for banning those who disconnect or timed team bans.

    Features:
    - CT Bans are stored in the ClientPrefs database and survive map changes, re-joins, and server crashes.
    - The Rage Ban feature allows admins to CT ban rage quitters who break the server's rules and then quickly disconnect.
    - You may give a timed CT ban which will work based on in minutes spent alive (so idlers in spectate or those who suicide at the beginning of the round will not be working toward an unban.)
    - The timed CT bans are stored in a SQL table for stateful access.
    - The plugin logs CT ban to a SQL table in addition to your regular SM logs.
    - Re-displays the team selection screen after an improper selection was made.
    - SM Menu integration for the rageban and ctban commands.
    - Displays helpful message to users who are CT banned when they join the server.
    - SM Translations support.

    Installation:
    Place the phrases.txt in your addons/sourcemod/translations directory.
    Place the .smx in your addons/sourcemod/plugins directory.
    Check your logs/server-console after the initial load for any SQL errors. If you have any SQL errors check your addons/sourcemod/configs/databases.cfg file and verify you can connect using the drivers you have specified.

    Command Usage:

    sm_ctban <player>
    Bans the selected player from joining the CT team.

    sm_removectban <player> | sm_unctban <player>
    Removes the CT ban on the selected player.

    sm_isbanned <player>
    Reports back the status of the current player's CT ban and the time remaining on the ban, if any.

    sm_rageban
    Brings up a menu so you may choose a recently disconnected player to permanently CT ban.

    sm_ctban_offline <steamid>
    Bans the given Steam Id from playing on the CT team.

    sm_removectban_offline <steamid> | sm_unctban_offline <steamid>
    Unbans the given Steam Id from the CT team.

    Settings:
    sm_ctban_enable, [0,1]: Toggles functionality. When set to 0 this will allow those players who are CT banned to join the CT team.
    sm_ctban_soundfile, <path>: The path to the soundfile to play when denying a team-change request. Set to "" to disable.
    sm_ctban_joinbanmsg, <message>: This message is appended to a time-stamp when a CT banned user joins the server.
    sm_ctban_table_prefix, <prefix>: This prefix will be added in front of the table names.
    sm_ctban_database_driver, <driver>: This specifies which driver to use from database.cfg

    Special Thanks:
    Azelphur for the idea of using bitmasks to improve efficiency and snippets of cross-mod code.
    Kigen for the idea of CT banning based on time spent alive.

    Future Considerations:
    Improved web interface
    Allowing for more than 7 reasons to CT Ban

    Change Log:
    1.6.1.3 Fixed bug with EscapeString function which caused query failures
    1.6.1.2 Fixed SQL Injection vulnerability
    1.6.1.1 Fixed problem in UTIL_TeamMenu()
    1.6.1 Added CS:GO protocol buffer support to UTIL_TeamMenu()
    1.6.0 Support for new SM1.4 natives, Added config file generation
    1.5.0 Initial public release
    1.4.4 Stable internal build
    Attached Files
    File Type: txt ctban.phrases.txt (2.2 KB, 4310 views)
    File Type: sp Get Plugin or Get Source (sm_ctban.sp - 3119 views - 44.8 KB)
    __________________
    Public Plugins | Please: No new private requests.

    Last edited by databomb; 03-21-2015 at 16:02. Reason: v 1.6.1.3
    databomb is offline
    daleGEND
    SourceMod Donor
    Join Date: Feb 2005
    Location: USA
    Old 08-31-2011 , 11:19   Re: [CS:S] CT Bans
    Reply With Quote #2

    Does this plugin not generate a config file? Would be nice.
    __________________
    Bor3d Gaming - A Mature Online Gaming Community

    Feel free to add me on STEAM as well: https://steamcommunity.com/id/b0r3d
    daleGEND is offline
    Rizla
    SourceMod Donor
    Join Date: Jun 2010
    Old 08-31-2011 , 12:48   Re: [CS:S] CT Bans
    Reply With Quote #3

    3rd one btw:

    http://forums.alliedmods.net/showthread.php?p=1475185

    uses mysql, just to chuck it out there, but doesnt allow offline/timed etc. unlike yours (or reasons)
    Rizla is offline
    databomb
    Veteran Member
    Join Date: Jun 2009
    Location: Boston, MA
    Old 08-31-2011 , 14:07   Re: [CS:S] CT Bans
    Reply With Quote #4

    Quote:
    Originally Posted by daleGEND View Post
    Does this plugin not generate a config file? Would be nice.
    Yeah, definitely an oversight that will be fixed in the next update, which will be as soon as the bug's patch file gets posted in the SM repo.

    daleGEND, could you help out with the PHP part of this project at all? I noticed your occupation on the forums said web developer.
    __________________
    Public Plugins | Please: No new private requests.
    databomb is offline
    Zephyrus
    Cool Pig B)
    Join Date: Jun 2010
    Location: Hungary
    Old 08-31-2011 , 14:45   Re: [CS:S] CT Bans
    Reply With Quote #5

    Quote:
    Originally Posted by databomb View Post
    Yeah, definitely an oversight that will be fixed in the next update, which will be as soon as the bug's patch file gets posted in the SM repo.

    daleGEND, could you help out with the PHP part of this project at all? I noticed your occupation on the forums said web developer.
    i can help you with that if you add me on steam
    __________________
    Taking private C++/PHP/SourcePawn requests, PM me.
    Zephyrus is offline
    daleGEND
    SourceMod Donor
    Join Date: Feb 2005
    Location: USA
    Old 08-31-2011 , 15:20   Re: [CS:S] CT Bans
    Reply With Quote #6

    Quote:
    Originally Posted by databomb View Post
    Yeah, definitely an oversight that will be fixed in the next update, which will be as soon as the bug's patch file gets posted in the SM repo.

    daleGEND, could you help out with the PHP part of this project at all? I noticed your occupation on the forums said web developer.
    Would love to, but I am neck deep in other projects at the moment. Great job on this addon btw.
    __________________
    Bor3d Gaming - A Mature Online Gaming Community

    Feel free to add me on STEAM as well: https://steamcommunity.com/id/b0r3d
    daleGEND is offline
    xrefresh
    SourceMod Donor
    Join Date: Apr 2011
    Old 10-18-2011 , 22:16   Re: [CS:S] CT Bans
    Reply With Quote #7

    Having problems with CT bans. Also the offline steam id command doesn't work. In-game on console it says unknown command.

    Errors:

    Code:
    L 10/18/2011 - 19:11:29: SourceMod error session started
    L 10/18/2011 - 19:11:29: Info (map "cs_office") (file "errors_20111018.log")
    L 10/18/2011 - 19:11:29: [SM] Native "SQL_TQuery" reported: Invalid database Handle 0 (error: 4)
    L 10/18/2011 - 19:11:29: [SM] Displaying call stack trace for plugin "sm_ctban.smx":
    L 10/18/2011 - 19:11:29: [SM]   [0]  Line 201, sm_ctban.sp::OnClientAuthorized()
    L 10/18/2011 - 19:11:30: [SM] Native "SQL_TQuery" reported: Invalid database Handle 0 (error: 4)
    L 10/18/2011 - 19:11:30: [SM] Displaying call stack trace for plugin "sm_ctban.smx":
    L 10/18/2011 - 19:11:30: [SM]   [0]  Line 201, sm_ctban.sp::OnClientAuthorized()
    L 10/18/2011 - 19:11:30: [SM] Native "SQL_TQuery" reported: Invalid database Handle 0 (error: 4)
    L 10/18/2011 - 19:11:30: [SM] Displaying call stack trace for plugin "sm_ctban.smx":
    L 10/18/2011 - 19:11:30: [SM]   [0]  Line 201, sm_ctban.sp::OnClientAuthorized()
    L 10/18/2011 - 19:11:30: [SM] Native "SQL_TQuery" reported: Invalid database Handle 0 (error: 4)
    L 10/18/2011 - 19:11:30: [SM] Displaying call stack trace for plugin "sm_ctban.smx":
    L 10/18/2011 - 19:11:30: [SM]   [0]  Line 201, sm_ctban.sp::OnClientAuthorized()
    L 10/18/2011 - 19:11:30: [SM] Native "SQL_TQuery" reported: Invalid database Handle 0 (error: 4)
    L 10/18/2011 - 19:11:30: [SM] Displaying call stack trace for plugin "sm_ctban.smx":
    L 10/18/2011 - 19:11:30: [SM]   [0]  Line 201, sm_ctban.sp::OnClientAuthorized()
    L 10/18/2011 - 19:11:30: [SM] Native "SQL_TQuery" reported: Invalid database Handle 0 (error: 4)
    L 10/18/2011 - 19:11:30: [SM] Displaying call stack trace for plugin "sm_ctban.smx":
    L 10/18/2011 - 19:11:30: [SM]   [0]  Line 201, sm_ctban.sp::OnClientAuthorized()
    L 10/18/2011 - 19:11:30: [SM] Native "SQL_TQuery" reported: Invalid database Handle 0 (error: 4)
    L 10/18/2011 - 19:11:30: [SM] Displaying call stack trace for plugin "sm_ctban.smx":
    L 10/18/2011 - 19:11:30: [SM]   [0]  Line 201, sm_ctban.sp::OnClientAuthorized()
    L 10/18/2011 - 19:11:30: [SM] Native "SQL_TQuery" reported: Invalid database Handle 0 (error: 4)
    L 10/18/2011 - 19:11:30: [SM] Displaying call stack trace for plugin "sm_ctban.smx":
    L 10/18/2011 - 19:11:30: [SM]   [0]  Line 201, sm_ctban.sp::OnClientAuthorized()
    L 10/18/2011 - 19:11:30: [SM] Native "SQL_TQuery" reported: Invalid database Handle 0 (error: 4)
    L 10/18/2011 - 19:11:30: [SM] Displaying call stack trace for plugin "sm_ctban.smx":
    L 10/18/2011 - 19:11:30: [SM]   [0]  Line 201, sm_ctban.sp::OnClientAuthorized()
    L 10/18/2011 - 19:11:30: [SM] Native "SQL_TQuery" reported: Invalid database Handle 0 (error: 4)
    L 10/18/2011 - 19:11:30: [SM] Displaying call stack trace for plugin "sm_ctban.smx":
    L 10/18/2011 - 19:11:30: [SM]   [0]  Line 201, sm_ctban.sp::OnClientAuthorized()
    L 10/18/2011 - 19:11:30: [SM] Native "SQL_TQuery" reported: Invalid database Handle 0 (error: 4)
    L 10/18/2011 - 19:11:30: [SM] Displaying call stack trace for plugin "sm_ctban.smx":
    L 10/18/2011 - 19:11:30: [SM]   [0]  Line 201, sm_ctban.sp::OnClientAuthorized()
    L 10/18/2011 - 19:11:30: [SM] Native "SQL_TQuery" reported: Invalid database Handle 0 (error: 4)
    L 10/18/2011 - 19:11:30: [SM] Displaying call stack trace for plugin "sm_ctban.smx":
    L 10/18/2011 - 19:11:30: [SM]   [0]  Line 201, sm_ctban.sp::OnClientAuthorized()
    Cvars:

    Code:
    public OnPluginStart()
    {
    	CreateConVar("sm_ctban_version", PLUGIN_VERSION, "CT Ban Version", FCVAR_SPONLY|FCVAR_DONTRECORD|FCVAR_REPLICATED|FCVAR_NOTIFY);
    	gH_Cvar_Enabled = CreateConVar("sm_ctban_enable","1","Enables CT bans cookie handling", FCVAR_PLUGIN);
    	gH_Cvar_SoundName = CreateConVar("sm_ctban_soundfile", "buttons/button11.wav", "The name of the sound to play when an action is denied",FCVAR_PLUGIN);
    	gH_Cvar_JoinBanMessage = CreateConVar("sm_ctban_joinbanmsg", "CT banned", "This text is appended to the time the user was last CT banned when they join T or Spectator teams.", FCVAR_PLUGIN);
    	gH_Cvar_Table_Prefix = CreateConVar("sm_ctban_table_prefix", "ctban", "Adds a prefix to the CT Bans table, leave this blank unless you have a need to add a prefix for multiple servers on one database.", FCVAR_PLUGIN);
    	gH_Cvar_Database_Driver = CreateConVar("sm_ctban_database_driver", "default", "Specifies the configuration driver to use from SourceMod's database.cfg", FCVAR_PLUGIN);
    Database:

    Code:
    "Databases"
    {
    	"driver_default"		"mysql"
    	
    	"default"
    	{
    		"driver"			"mysql"
    		"host"				"localhost"
    		"database"			"sourcemod"
    		"user"				"user"
    		"pass"				"blah"
    		//"timeout"			"0"
    		"port"			"3306"
    	}

    Last edited by xrefresh; 10-18-2011 at 23:29.
    xrefresh is offline
    databomb
    Veteran Member
    Join Date: Jun 2009
    Location: Boston, MA
    Old 10-19-2011 , 07:14   Re: [CS:S] CT Bans
    Reply With Quote #8

    Quote:
    In-game on console it says unknown command.
    only plausible reason is Feature Not Available isn't in your translation file. in either case, this feature won't start working until 1.40 is released.

    Why did you post the OnPluginStart code instead of your config file?

    Did all these errors occur on a map change? Sounds like a local database problem if it connects on startup and then fails after a mapchange.
    __________________
    Public Plugins | Please: No new private requests.

    Last edited by databomb; 10-19-2011 at 07:15.
    databomb is offline
    away000
    Veteran Member
    Join Date: Sep 2010
    Old 10-19-2011 , 07:55   Re: [CS:S] CT Bans
    Reply With Quote #9

    Quote:
    Originally Posted by databomb View Post
    only plausible reason is Feature Not Available isn't in your translation file. in either case, this feature won't start working until 1.40 is released.

    Why did you post the OnPluginStart code instead of your config file?

    Did all these errors occur on a map change? Sounds like a local database problem if it connects on startup and then fails after a mapchange.
    Have a chance to integrate with Sourcebans?
    __________________
    away000 is offline
    xrefresh
    SourceMod Donor
    Join Date: Apr 2011
    Old 10-19-2011 , 13:57   Re: [CS:S] CT Bans
    Reply With Quote #10

    Quote:
    only plausible reason is Feature Not Available isn't in your translation file. in either case, this feature won't start working until 1.40 is released.
    The feature not available part is in the translation file.

    Quote:
    Why did you post the OnPluginStart code instead of your config file?
    I thought you had to edit that part, didn't really notice the config part in the OP. How would I go about making a config file for it?

    Quote:
    Did all these errors occur on a map change? Sounds like a local database problem if it connects on startup and then fails after a mapchange.
    It happens when the server starts. As for map change, I'll check on that to see if it does it.

    Last edited by xrefresh; 10-19-2011 at 14:01.
    xrefresh 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 09:05.


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