Raised This Month: $2 Target: $400
 0% 

VAC Ban Status


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands        Approver:   Hawk552 (427)
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-27-2009 , 02:10   VAC Ban Status
Reply With Quote #1

VAC Ban Status v0.3

Description
This plugin will check if a steam account has ever been VAC banned. Checking an account can be done in 2 ways; manually via console and auto. Auto checking will automatically check a player either when they first connect to the server or when they join a team. To specify when a player is checked, set the cvar vbs_vaccheck to the appropriate value (default: 0 [on connect]). If a VAC ban is found on a players steam account then the selected punishment will be issued on player. There are 5 punishments to choose from (see below enum) which can be defined by cvar vbs_punishment (default: 0 [log only]). Punishments can be issued either when a VAC ban status is found or when the player reaches a specified kill\death ratio. To make a punishment be issued when the player reaches a specified kill-death ratio, select the appropriate punishment below. Each punishment named KDRATIO will be issued once the player reaches the kill\death ratio. To specify the kill-death ratio, set it in the cvar vbs_kdratio (default 3 [3:1]). You can also specify a minimum kills value for when the plugin will start to check a players kill\death ratio; to set this value set cvar vbs_kdminkills to the appropriate value (default: 15 [kills]). When auto-checking is enabled, the server will check the VAC ban status on the steam server and save the ban status value to the database. If the player is not banned, the database entry is added with a timestamp that will expire in the number of days defined in cvar vbs_expiredays (default: 15 [days]). This will prevent a plugin from having to constantly re-check a player everytime they connect. When the entry expires, they will get re-checked on the steam server on their next connection. If a VAC ban is found on a steam account, the database is permanent and will never expire. If a player connects that has a positive VAC ban status saved to the database, the selected punishment will be issued. There is a whitelisting system that allows you to whitelist particular players steam accounts. This will make the plugin not recognize them as being VAC banned and they will be immune to the plugin until they are removed from the whitelist.

This is a port of an existing sourcemod plugin: http://forums.alliedmods.net/showthread.php?t=80942

Commands
  • amx_vacban <name\steamid> - Check a players VAC ban status
  • amx_vacclearall - Clear all entries from database
  • amx_vacclearnotbanned - Clear all non-VAC banned entries from database
  • amx_vacremoveentry <name\steamid> - Remove an entry from database
  • amx_vacaddwhitelist <name\steamid> - Add a player to whitelist. Player will be considered not banned.
  • amx_vacremovewhitelist <name\steamid> - Remove a player from whitelist
  • amx_vacquery <name\steamid> - Query the database for a players VAC ban status
CVars
Code:
///////////////////////////////////////////////////////////////////////////
//   *************** VAC Ban Status Configuration File ****************  //	
///////////////////////////////////////////////////////////////////////////

echo Executing VAC Ban Status Configuration File

///////////////////////////////////////////////////////////////////////////
// Enable\Disable auto checking						 //
///////////////////////////////////////////////////////////////////////////
// 0 - Disabled								 //
// 1 - Enabled								 //
///////////////////////////////////////////////////////////////////////////
// Default: 1		     						 //
///////////////////////////////////////////////////////////////////////////

vbs_autocheck 1 

///////////////////////////////////////////////////////////////////////////
// Specify when auto-check is performed					 //
///////////////////////////////////////////////////////////////////////////
// 0 - When the player connects						 //
// 1 - When the player joins a team					 //
///////////////////////////////////////////////////////////////////////////
// Default: 0								 //
///////////////////////////////////////////////////////////////////////////

vbs_vaccheck 0

///////////////////////////////////////////////////////////////////////////
// The number of days at which VAC ban status values written to the db   //
// will expire. This will only affect players who are not VAC banned. If //
// a VAC ban is found on a player it is a permanent entry and will not   //
// expire.								 //
///////////////////////////////////////////////////////////////////////////
// Default: 15								 //
///////////////////////////////////////////////////////////////////////////

vbs_expiredays 15

///////////////////////////////////////////////////////////////////////////
// Punish method if VAC ban found					 //
///////////////////////////////////////////////////////////////////////////
// 0 - Log only (no punishment)						 //
// 1 - Kick only							 //
// 2 - Kick and ban using the players Steam ID				 //
// 3 - Kick and ban using the players IP address			 //
// 4 - Kick and ban via AMX ban						 //
// 5 - Shoot blanks, SteamID, reapplied if user reconnects		 //
// 6 - Kick only [KDRATIO]						 //
// 7 - Kick and ban using the players Steam ID [KDRATIO]		 //
// 8 - Kick and ban using the players IP address [KDRATIO]		 //
// 9 - Kick and ban via AMX ban	[KDRATIO]				 //
// 10 - Shoot blanks, SteamID, reapplied if user reconnects [KDRATIO]	 //
///////////////////////////////////////////////////////////////////////////
// Default: 0								 //
///////////////////////////////////////////////////////////////////////////

vbs_punishment 0

///////////////////////////////////////////////////////////////////////////
// Flag required for plugin notification				 //
///////////////////////////////////////////////////////////////////////////
// Can be any admin flag 						 //
///////////////////////////////////////////////////////////////////////////
// Default: "d"								 //
///////////////////////////////////////////////////////////////////////////

vbs_notifyflag "d"

///////////////////////////////////////////////////////////////////////////
// The time at which a connecting socket is considered timed-out. At     //
// this number of seconds, if the plugin does not receive a response     //
// from the steam server it will drop the connection.			 //
///////////////////////////////////////////////////////////////////////////
// Default: 5								 //
///////////////////////////////////////////////////////////////////////////

vbs_sockettimeout 5

///////////////////////////////////////////////////////////////////////////
// The kill:death ratio needed for KDRATIO punishments to take effect.   //
// When a VAC ban is first found on the player, the punishment is not    //
// applied. The plugin will wait until when\if the player player and     //
// reaches this kd ratio and then apply punishment. The same will happen //
// if the player re-connects. 						 //
///////////////////////////////////////////////////////////////////////////
// Default: 3								 //
///////////////////////////////////////////////////////////////////////////

vbs_kdratio 3

///////////////////////////////////////////////////////////////////////////
// The number of kills required before kill:death ratio is evaluated     //
// when using a KDRATIO punishment					 //
///////////////////////////////////////////////////////////////////////////
// You can use any number						 //
///////////////////////////////////////////////////////////////////////////
// Default: 15								 //
///////////////////////////////////////////////////////////////////////////

vbs_kdminkills 15

///////////////////////////////////////////////////////////////////////////
// The ban duration used for all ban punishments.			 // 
///////////////////////////////////////////////////////////////////////////
// 0 - Permanent							 //
// 1+ - Number of minutes						 //
///////////////////////////////////////////////////////////////////////////
// Default: 0 								 //
///////////////////////////////////////////////////////////////////////////

vbs_bantime 0
Punishments
  • 0 = Log only
  • 1 = Kick only
  • 2 = Kick & ban by Steam ID
  • 3 = Kick & ban by IP
  • 4 = Kick & AMX ban
  • 5 = Shoot blanks
  • 6 = Kick only [KD Ratio]
  • 7 = Kick & ban by Steam ID [KD Ratio]
  • 8 = Kick & ban by IP [KD Ratio]
  • 9 = Kick & AMX ban [KD Ratio]
  • 10 = Shoot blanks [KD Ratio]
Required Modules
  • Sockets
  • Fakemeta
  • nVault
Credits
voogru - Discovering how to convert steamid to community id.
danielkza - AMX-X script to do steamid to community id conversion.
Mordekay - Beta testing

ChangeLog
  • v0.3
    - Improved speed of checking by increasing incoming data buffer size to 4096. Defined by BUFFER_SIZE
    - I noticed at times particular steam id checks would not work. I found that depending on the size of the users steam community page, the incoming data was sometimes cut off in the middle of a string/phrase we are looking for. For example, if we are looking for "<vacBanned>1" for ban status. One packet would have "<vacB" and the following packet would start with "anned>1" causing the plugin to not notice the ban string. Now, when data is received it is added to the previously received data so the detection strings can be checked within the entire buffer.
    - Fixed bug where if you try to manually check a SteamID and accidentally have a space on the end it would print out checking SteamID [].
    - Replaced set_user_hitzones with fm_set_user_hitzones. Removed fun module, fakemeta is now required.
    - Revised\improved DeathMsg code for applying punishment based on kill\death ratio.
    - Changed punishment and notify admin flag selection to cvar.
    - Added cvar to specify the seconds used to consider a connection to steam server as timedout. The cvar that specifies the time out is vbs_sockettimeout [default 5.0]
    - Added KICK_BAN_ID_KDRATIO and KICK_BAN_IP_KDRATIO, these were both accidentally not coded.
    - Added punishment function so all punishments are issued in one place instead of having them coded multiple times.
    - Added cvar to specify the time period to ban a player when a ban punishment is used. vbs_bantime [default: 0]
    - Added clear all command to clear the database of all entries (everything, including both VAC banned\unbanned status and whitelist entries). Note: You cannot clear all whitelisted or all VAC banned without clearing the entire db.
    - Added clear non VAC banned command to clear database of entires that are not VAC banned (VAC banned and whitelist entries will remain in database). Command: amx_vacclearall
    - Added whitelist system so you can whitelist a steamid\player. When whitelisted, the player will be treated as if they have no VAC ban and will not get checked. The whitelist entry is permanent and will not be cleared unless done so manually with the amx_vacremovewhitelist or amx_vacclearall command.
    Commands: amx_vacaddwhitelist , amx_vacremovewhitelist
    - Added query command so you can manually check a players entry in the db. Command: amx_vacquery
    - Added display of time that a manual VAC ban status check took with steam server.
    - Added cvar to set when a player is auto-checked vbs_vaccheck [default: 0] 0=on connect, 1=team join [T\CT only]
    - Switched back to regular sockets module as sockets_hz didn't solve the lag issue.
    - Added error checking when opening vault. Since almost every function of the plugin uses vault communication, if the vault does not open properly then the plugin cannot function as it was designed to. If an error is found when opening the nvault file, the plugin will fail and report an error in log.
    - Corrected AMXBan usage.
    - Added usage of config file (vacbanstatus.cfg)

Downloads
0.2b 279
0.2 458
0.1 77
Attached Files
File Type: cfg vacbanstatus.cfg (5.2 KB, 3009 views)
File Type: sma Get Plugin or Get Source (vacbans.sma - 5506 views - 35.1 KB)
__________________

Last edited by Bugsy; 04-29-2009 at 11:48. Reason: new release
Bugsy is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 01-27-2009 , 02:42   Re: VAC Ban Status
Reply With Quote #2

Yeah, i'm first!!

Nice.
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 01-27-2009 , 02:46   Re: VAC Ban Status
Reply With Quote #3

You spelled my nickname wrong

Good work anyway
__________________

Community / No support through PM
danielkza is offline
-=[BFC]=- Shooter_McGavin
Member
Join Date: Nov 2005
Location: Berlin
Old 01-27-2009 , 05:30   Re: VAC Ban Status
Reply With Quote #4

Big Thanks....
__________________
-=[BFC]=- Shooter_McGavin is offline
Send a message via ICQ to -=[BFC]=- Shooter_McGavin
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 01-27-2009 , 06:21   Re: VAC Ban Status
Reply With Quote #5

Sexyyy
BOYSplayCS is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 01-27-2009 , 06:46   Re: VAC Ban Status
Reply With Quote #6

I'm not sure I understand. If they're VAC banned and you're running a secured server, wouldn't they NOT be able to get on your server in the first place? Thus, isn't this only useful for non-steam?
__________________
Brad is offline
-=[BFC]=- Shooter_McGavin
Member
Join Date: Nov 2005
Location: Berlin
Old 01-27-2009 , 06:48   Re: VAC Ban Status
Reply With Quote #7

Vac is banning for engine , if you are in Source Vac banned your not banned in HL1 engine!!!
__________________

Last edited by -=[BFC]=- Shooter_McGavin; 01-27-2009 at 08:06. Reason: energine = engine
-=[BFC]=- Shooter_McGavin is offline
Send a message via ICQ to -=[BFC]=- Shooter_McGavin
tuty
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 01-27-2009 , 07:28   Re: VAC Ban Status
Reply With Quote #8

energine = engine
__________________
All my lifetime work is there (includin private big ass plugins and stuff) https://github.com/tutyamxx

tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 01-27-2009 , 09:00   Re: VAC Ban Status
Reply With Quote #9

Code:
char_to_num(chNum)
{
    new iNum;
    switch(chNum)
    {
        case '0':        iNum = 0;
        case '1':        iNum = 1;
        case '2':        iNum = 2;
        case '3':        iNum = 3;
        case '4':        iNum = 4;
        case '5':        iNum = 5;
        case '6':        iNum = 6;
        case '7':        iNum = 7;
        case '8':        iNum = 8;
        case '9':        iNum = 9;
    }
    
    return iNum;
}
Why didn't you just use str_to_num()?

Code:
num_to_char(iNum)
{
    new chNum;
    switch(iNum)
    {
        case 0:        chNum = '0';
        case 1:        chNum = '1';
        case 2:        chNum = '2';
        case 3:        chNum = '3';
        case 4:        chNum = '4';
        case 5:        chNum = '5';
        case 6:        chNum = '6';
        case 7:        chNum = '7';
        case 8:        chNum = '8';
        case 9:        chNum = '9';
    }
    
    return chNum;
}
Why didn't you just use num_to_str()?
__________________
Brad is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-27-2009 , 10:43   Re: VAC Ban Status
Reply With Quote #10

Quote:
Originally Posted by danielkza View Post
You spelled my nickname wrong

Good work anyway
Sorry, I fixed it. :-B

Quote:
Originally Posted by Brad View Post
Why didn't you just use str_to_num()?

Why didn't you just use num_to_str()?
I thought the same exact thing when I was looking at it. The steamid to community-id code was copied directly from an already existing plugin and I assumed there was reasoning behind it so I didn't bother changing it. Will str_to_num and num_to_str work on a single character?
__________________

Last edited by Bugsy; 01-27-2009 at 10:58.
Bugsy 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 08:43.


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