Raised This Month: $12 Target: $400
 3% 

[CS:S/CS:GO] CT Bans


Post New Thread Reply   
 
Thread Tools Display Modes
Author
databomb
Veteran Member
Join Date: Jun 2009
Location: california
Plugin ID:
2527
Plugin Version:
2.0.3
Plugin Category:
Admin Commands
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
    9 
    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/CS:GO] CT Bans
    by: databomb

    Description:
    Allows admins to restrict access to the CT team from those who violate the server's rules. Designed for specific usage in Jailbreak environments.

    v2.0.0 Feature Details:
    https://forums.alliedmods.net/showpo...&postcount=330
    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.
    - Custom reasons permitted (addons/sourcemod/configs/ctban_reasons.ini).
    - Custom ban lengths permitted (addons/sourcemod/configs/ctban_times.ini)

    Installation:
    Place the ctban.phrases.txt file in your addons/sourcemod/translations directory.
    Place the sm_ctban.smx file 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.
    Upgrade: Delete cfg/sourcemod/ctban.cfg or manually add new convars to the file.
    Optional: Generate custom reasons list by creating a simple text file (addons/sourcemod/configs/ctban_reasons.ini) with 1 reason per line.
    Spoiler

    Optional: Generate custom times in (addons/sourcemod/configs/ctban_times.ini)
    Spoiler


    Command Usage:

    sm_ctban <player> <time> <optional: reason>
    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.

    sm_reset_ctban_cookies <'force'>
    Resets the entire CTBan cookie database.

    sm_forcect <player>
    Overrides any CTBans and swaps a player to CT team.

    sm_unforcect <player>
    Removes overrides and moves player to T team.

    sm_isbanned_offline <steamid>
    Reports back the status of the target Steam Id from the ban database.

    sm_change_ctban_time <player> <time>
    Changes an existing CTBan to the new time specified. 0 would be permanently CTBan.

    sm_ctbanlist
    Displays a menu of active players who are CT Banned.

    Settings:
    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
    sm_ctban_force_reason, [0,1]: Specifies whether a reason is required for the CT Ban command.
    sm_ctban_checkctbans_adminflags, [a-z]: Specifies the admin flag levels that may use the !ctbanlist and !isbanned command targeting anyone. Blank allows all players access on everyone.
    sm_ctban_isbanned_selftarget, [0,1]: Specifies whether a non-admin can target themselves using the !isbanned command.
    sm_ctban_respawn, [0,1]: Specifies whether to respawn players after team changes.

    Special Thanks (Development):
    Azelphur for snippets of cross-mod code.
    Kigen for the idea of CT banning based on time spent alive.
    oaaron99 for the idea of smart !ctban menu re-directs.
    Bara for include file ideas.

    Future Considerations:
    Using API-- Steam Group CTBans

    Plugins Using CTBan API:
    !tctban Limited Timed CTBan for Lower Admins https://forums.alliedmods.net/showthread.php?p=2547113

    Change Log:
    2.0.3 Adds !rageban console user support. Fixed bug where !rageban was not permanent. Fixed bug with custom times (configs/ctban_times.ini) not displaying menu options correctly.
    Adds multi-targeting filters for other admin commands: @ctban @!ctban and @noctbans (@noctbans specifies players who have never had a CT Ban).
    2.0.2 Adds SQLite support. Updated include file: Adds more intelligent #tryinclude and pre-compile directives.
    Alerts admins if someone is swapped to CT without !forcect. Added custom times options (configs/ctban_times.ini).
    2.0.1 Small bug fixes in UnForceCT, ForceCT, and OnClientAuthorized code segments.
    2.0.0 Ported to the new syntax. Translation file updated. CS:GO Fixes bug where mp_force_pick_time could assign a banned player to CT. Made !ctban open menus if more info is needed.
    CS:GO Fixes incompatibility with Zephyrus's Team Limit Bypass plugin. Adds spawn check to verify CTBans. Added !forcect/!unforcect to override CTBan and swap players.
    Allows custom reasons (configs/ctban_reasons.ini). Allows non-admins to use !isbanned. Added command to reset all CT Ban cookies. Added Player Commands menu for !unctban.
    Adds CT Ban to !admin Player Commands menu. Allowed fallback for !isbanned to return ban info even if database log entries were missing. Added !ctbanlist command.
    Added CT Ban reason to !ctban chat output where possible. Changed from [SM] to [CTBAN] chat tag and added colors. Removing compile option USESQL (Now Always Uses SQL).
    Added !isbanned_offline to find CT Ban info of offline players. !ctban_offline and !unctban_offline now update the log database records.
    Added convar sm_ctban_respawn to allow respawns after team swaps due to !ctban or !forcect. Added !change_ctban_time command to edit the time remaining on CTBans.
    Added API (ctban.inc) for 3rd-party plugin interfaces. The convar sm_ctban_enable is being removed (disable the plugin to disable functionality).
    Upgraded database log table to include an auto incrementing primary key (ban_id) -- automatically upgrades from tables.
    Added check for enforcing CTBans if the plugin is loaded late.
    1.6.2 Translation file updated. Added admin, time, reason information for !isbanned. Show !rageban results in chat to players. Added ConVar for forcing !ctban reason.
    1.6.1.4 Fixed bug preventing console CT bans (thanks Kailo!)
    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 Support for new SM1.4 natives, Added config file generation
    1.6.0 Added support for new SM1.4 natives
    1.5.0 Initial public release
    1.4.4 Stable internal build
    Attached Files
    File Type: inc ctban.inc (15.5 KB, 2164 views)
    File Type: sp Get Plugin or Get Source (sm_ctban.sp - 6789 views - 113.3 KB)
    File Type: txt ctbans-list.txt (4.5 KB, 2364 views)
    File Type: txt ctban.phrases.txt (9.9 KB, 2447 views)
    __________________

    Last edited by databomb; 04-13-2018 at 12:49. Reason: fixed translation file error for "fr"
    databomb is offline
    daleGEND
    AlliedModders 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: california
    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.
    __________________
    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
    AlliedModders 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: california
    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.
    __________________

    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 16:21.


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