Help guys! I'm using MyJailbreak and then i banned someone for ct, he can join ct again. Also, then i'm selecting player in rageban, menu just closes.
Are you using the ctban in MyJailbreak or this plugin? Check the SourceMod logs directory and look at the error logs to see what is going on-- post that here.
Are you using the ctban in MyJailbreak or this plugin? Check the SourceMod logs directory and look at the error logs to see what is going on-- post that here.
I'm using this plugin to ban players. Error log doesn't include any errors with ctban.
I have 2 Feature request.
Maybe the sm_isbanned command should show the admin who ctbanned the player.
The RageBan should create informations in the mysql logs and bans.
I found a bug.
When you use rageban there is no reply in the chat, even if there is the default translation in use.
Changes:
The !isbanned command now lists the admin who performed the CT ban and the time of the CT ban
The !rageban command now shows the information in the Chat and Log
The !rageban command now logs bans to the MySQL CTBan Log
Added convar sm_ctban_force_reason, Default 0, allows you to specify whether admins need a reason for their CT ban when using the console or chat !ctban command
Thanks to Sples1 for testing all changes and Hungarian translations!
Changes:
The !isbanned command now lists the admin who performed the CT ban and the time of the CT ban
The !rageban command now shows the information in the Chat and Log
The !rageban command now logs bans to the MySQL CTBan Log
Added convar sm_ctban_force_reason, Default 0, allows you to specify whether admins need a reason for their CT ban when using the console or chat !ctban commnad
Thanks to Sples1 for testing all changes and Hungarian translations!
This is the first large update to CT Bans since its release in 2011. So, what has changed? Underneath the hood, there were a lot of changes including switching to the new SourcePawn syntax, eliminating magic numbers, and making the flow more efficient. Several changes relate to adding more compatibility for CS:GO as there are some unique server convars and behavior that have changed since the last update. But there are also a lot of new features to discuss as well.
Smart Menus for !ctban
If you only add some of the required information for the !ctban command. For instance,
Code:
!ctban databomb
Then it will bring up the next part of the process, so in this case the menu would appear to select a time. Credit goes to oaaron99 for this idea.
!isbanned for everyone
Before only admins were allowed to use !isbanned but now there are some new options to allow a wider audience to use it. First, there is convar sm_ctban_isbanned_selftarget which will allow non-admins to target *only* themselves. If you want non-admins to see anyone who is CTBanned then you can change the sm_ctban_checkctbans_adminflags convar to be empty.
Custom reasons
Adding custom reasons was somewhat of a pain before because you had to modify the translations file. And you were limited to only 7 reasons. Now if you would like custom reasons then just make a file called ctban_reasons.ini and place it in the addons/sourcemod/configs/ directory. For formatting the file, there's not much special: place each reason on its own line.
More translation support
The translation file has been updated with translations for the new features and some expanded translations for existing features.
!reset_ctban_cookies <'force'>
If you want to get rid of all of the existing CT Ban cookie information then this will effectively unban everyone. This is a pretty powerful command, so it is restricted to root admins only.
!ctbanlist
This will bring up a menu of the currently CT Banned players. Selecting a player will bring up additonal information in the chat. Non-admins could use this command, but to allow everyone access you have to set your sm_ctban_checkctbans_adminflags to be empty.
!forcect and !unforcect
So if you have a player who is CT banned but maybe an admin wants to see how they do on CT. Sort of a trial run, perhaps? They can use !forcect to swap them to the CT team. If they are misbehaving then !unforcect sends them back to the Terrorist team.
One important consideration: if all of the admins leave the server then it automatically swaps forced players back to the Terrorist team because no one is left to monitor them.
More logging information
The !ctban_offline and !unctban_offline commands now have more information being sent to the CTBan_Log for tracking. The !rageban command will output chat when it is used.
Colors!
The chat tag has changed from [SM] to [CTBAN]. CTBan will be in blue and the messages are in gold. If you don't like these colors then you can change them by editing the CHAT_BANNER for the engine you are using with new color values.
!change_ctban_time
This will allow admins to change the time on an existing CTBan. You can reduce or increase a timed ban. You can also change a timed ban to a permanent ban (use 0 for the time) or a permanent ban to a timed ban.
API
A brand new API allows improved 3rd-party plugin integration.
Spoiler
/** [CS:S/CS:GO] CT Bans
* Copyright (C) 2011-2017 by databomb
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Double #include protection
#if defined _ctban_included
#endinput
#endif
/**
* Checks if a client has been banned from CT.
*
* @param iClient Client index.
* @return The integer value of the CTBan cookie. A positive number indicates the client is CT Banned.
* @error Invalid client index.
*/
native int CTBan_IsClientBanned(int iClient);
/**
* Checks the amount of time remaining on a ban, if any.
*
* @param iClient Client index.
* @return The minutes left on the CT Ban. If the player is CT Banned a 0 indicates a permanent ban length.
* @error Invalid client index.
*/
native int CTBan_GetTimeRemaining(int iClient);
/**
* Checks if a client is allowed to play on the CT team even if they have a CT Ban.
*
* @param iClient Client index.
* @return True if the client is allowed to play on CT; false otherwise.
* @error Invalid client index.
*/
native bool CTBan_GetOverrideStatus(int iClient);
/**
* Retrieve information on a CT Ban based on client index. The results are returned in the CTBan_GetBanInfoReturn forward.
* The matching client index will be returned in the CTBan_GetBanInfoReturn forward.
*
* @param iClient Client index.
* @error Invalid client index.
*/
native void CTBan_GetBanInfo(int iClient);
/**
* Retrieve information on a CT Ban. The results are returned in the CTBan_GetOfflineBanInfoReturn forward.
* The matching client AuthID will be returned in the CTBan_GetOfflineBanInfoReturn forward.
*
* @param sAuthID Client AuthID.
* @error Invalid client AuthID or AuthID currently connected to server.
*/
native void CTBan_GetBanInfo_Offline(char[] sAuthID);
/**
* Issues a CT Ban on the target in-game player.
*
* @param iClient Client index.
* @param iMinutes Ban duration in minutes spent alive (0 for permanent duration).
* @param iAdmin Admin index.
* @param sReason Reason for ban.
* @error Invalid client index, Invalid time (less than 0), Invalid admin index, or Invalid reason.
*/
native void CTBan_Client(int iClient, int iMinutes = CTBAN_PERMANENT_BAN_DURATION, int iAdmin = CTBAN_ADMIN_IS_CONSOLE, char[] sReason = "No Reason Given.");
/**
* Issues a CT Ban on the target AuthID.
*
* @param sAuthID Client AuthID.
* @error Old version of SourceMod, Invalid client AuthID, or AuthID currently connected to server.
*/
native void CTBan_Client_Offline(char[] sAuthID);
/**
* Changes the length of an existing CT Ban.
*
* @param iClient Client index.
* @param iMinutes Ban duration in minutes spent alive (0 for permanent duration).
* @param iAdmin Admin index.
* @error Client Not CT Banned, Invalid client index, Invalid time (less than 0 or same time as existing CT Ban), or Invalid admin index.
*/
native void CTBan_ChangeBanLength(int iClient, int iMinutes, int iAdmin = CTBAN_ADMIN_IS_CONSOLE);
/**
* Issues a CT UnBan on the target in-game player.
*
* @param iClient Client index.
* @param iAdmin Admin index.
* @error Client Not CT Banned, Invalid client index, Invalid admin index, or Cookies Not Cached.
*/
native void CTBan_UnbanClient(int iClient, int iAdmin = CTBAN_ADMIN_IS_CONSOLE);
/**
* Issues a CT UnBan on the target AuthID.
*
* @param sAuthID Client AuthID.
* @error Old version of SourceMod, Invalid client AuthID, or AuthID currently connected to server.
*/
native void CTBan_UnbanClient_Offline(char[] sAuthID);
/**
* Allows target to temporarily play on CT Team regardless of CT Ban status.
*
* @param iClient Client index.
* @param iAdmin Admin index.
* @error Client Already on CT Team, Invalid client index, or Invalid admin index.
*/
native void CTBan_ForceCT(int iClient, int iAdmin = CTBAN_ADMIN_IS_CONSOLE);
/**
* Removes any temporary override of a CT Ban placed on target.
*
* @param iClient Client index.
* @param iAdmin Admin index.
* @error Invalid client index or Invalid admin index.
*/
native void CTBan_UnForceCT(int iClient, int iAdmin = CTBAN_ADMIN_IS_CONSOLE);
/**
* Paired response to CTBan_GetBanInfo native.
*
* @param bFoundCompleteInfo False only iClient and iTimeLeft is returned, otherwise all information is retrievable (Note: Reason may be blank).
* @param iClient Client index.
* @param iTimeLeft CT Ban duration remaining in minutes spent alive (0 indicates permanent duration).
* @param iTimeStamp UNIX timestamp of when the ban was initially entered.
* @param sAdminName Admin name at the time of the CT Ban.
* @param sReason CT Ban reason (Note: Reason may be blank).
*/
forward void CTBan_GetBanInfoReturn(bool bFoundCompleteInfo, int iClient, int iTimeLeft, int iTimeStamp, char[] sAdminName, char[] sReason);
/**
* Paired response to CTBan_GetBanInfo_Offline native.
*
* @param bFoundInfo False only sAuthID is returned, otherwise all information is retrievable (Note: Reason may be blank).
* @param sAuthID Client AuthID.
* @param iTimeLeft CT Ban duration remaining in minutes spent alive (0 indicates permanent duration).
* @param iTimeStamp UNIX timestamp of when the ban was initially entered.
* @param sAdminName Admin name at the time of the CT Ban.
* @param sReason CT Ban reason (Note: Reason may be blank).
* @param sPerpName The CT Banned player's name at the time of the CT Ban.
*/
forward void CTBan_GetOfflineBanInfoReturn(bool bFoundInfo, char[] sAuthID, int iTimeLeft, int iTimeStamp, char[] sAdminName, char[] sReason, char[] sPerpName);
/**
* Called when a client is CT Banned.
*
* @param iClient Client index.
* @param iAdmin Admin index.
* @param iMinutes CT Ban duration remaining in minutes spent alive (0 indicates permanent duration).
* @param sReason CT Ban reason (Note: Reason may be blank).
*/
forward void CTBan_OnClientBan(int iClient, int iAdmin, int iMinutes, const char[] sReason);
/**
* Called when a client is CT UnBanned.
*
* @param iClient Client index.
* @param iAdmin Admin index.
*/
forward void CTBan_OnClientUnban(int iClient, int iAdmin);
/**
* Called when a client is Offline CT Banned.
*
* @param sAuthID Client AuthID.
* @param iAdmin Admin index.
*/
forward void CTBan_OnClientBan_Offline(char[] sAuthID, int iAdmin);
/**
* Called when a client is Offline CT UnBanned.
*
* @param sAuthID Client AuthID.
* @param iAdmin Admin index.
*/
forward void CTBan_OnClientUnban_Offline(char[] sAuthID, int iAdmin);
/**
* Called when a client is forced to CT even if the player has a CT Ban.
*
* @param iClient Client index.
* @param iAdmin Admin index.
*/
forward void CTBan_OnForceCT(int iClient, int iAdmin);
/**
* Called when a temporary override on CT Ban status is removed.
*
* @param iClient Client index.
* @param iAdmin Admin index.
*/
forward void CTBan_OnUnforceCT(int iClient, int iAdmin);
public SharedPlugin __pl_ctban =
{
name = "ctban",
file = "ctban.smx",
#if defined REQUIRE_PLUGIN
required = 1,
#else
required = 0,
#endif
};
Database improvements
This will update the table structure in your *_CTBan_Log table to add a unique ID number for each ban. The previous primary key was the timestamp, which prevented CT Banning players on the same second. If you would like to manually update your table structure then connect to the database and issue the following queries (Make sure to add a Table prefix before CTBan_Log if you are using one):
PHP Code:
ALTER TABLE CTBan_Log DROP PRIMARY KEY; ALTER TABLE CTBan_Log ADD ban_id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT FIRST;
Late load protection
If the CTBan plugin is loaded late then it will automatically enforce any existing CTBans immediately on load.
More !admin Menu Support
The !ctban is now in the !admin Player Commands menu along with !rageban. There are also some more newcomers to the !admin Player Commands menu: !forcect, !unforcect, and !unctban
!isbanned_offline <authid>
This is a new command to get additional info if all you have is their STEAM ID. It will query the database and return the information without having to have the server operator delve into the tables.
sm_ctban_respawn
This new convar will allow players to be respawned after their CT Ban. The default is to not respawn.
The lines of code here has almost doubled in size. Efforts were made to test all features but not all situations may have been tested. If you do encounter issues, provide details on how to see the problem.
Installation Instructions
Compile sm_ctban.sp
Place sm_ctban.smx in addons/sourcemod/plugins
Download the ctban.phrases.txt and place this in addons/sourcemod/translations
Optional: Generate custom reasons list by creating a simple text file (addons/sourcemod/configs/ctban_reasons.ini) with 1 reason per line.
Start the plugin or manually update the database tables.
Delete the cfg/sourcemod/ctban.cfg file or update the file with the new convar names for version 2.0.0:
Quote:
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.