Skip to content

Commit 69d82fb

Browse files
committed
feat(vac_check): release v1.1.0
- Adds 'sm_vac_penalty_type' convar to control if player is banned (default) or kicked
1 parent 61d3198 commit 69d82fb

3 files changed

Lines changed: 19 additions & 7 deletions

File tree

178 Bytes
Binary file not shown.

Plugins/vac_check/scripting/vac_check.sp

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <updater>
2929

3030
// #define DEBUG
31-
#define VERSION "1.0.1"
31+
#define VERSION "1.1.0"
3232
#define UPDATE_URL "https://raw.githubusercontent.com/llamasking/sourcemod-plugins/master/Plugins/vac_check/updatefile.txt"
3333
#define BAN_REASON "[VAC Check] VAC/Game bans are either too many or too recent"
3434

@@ -50,13 +50,15 @@ ConVar g_apiKey;
5050
ConVar g_vacMaxAge;
5151
ConVar g_maxBanCount;
5252
ConVar g_banLength;
53+
ConVar g_penaltyType;
5354
bool g_bSourceBansPP = false;
5455

5556
public void OnPluginStart()
5657
{
5758
CreateConVar("sm_vac_version", VERSION, "VAC Check version.", FCVAR_NOTIFY | FCVAR_DONTRECORD);
5859
g_apiKey = CreateConVar("sm_vac_api_key", "", "Your Steam Web API Key", FCVAR_PROTECTED);
5960
g_vacMaxAge = CreateConVar("sm_vac_max_age", "2555", "The minimum age (in days) of a VAC/game ban before it is forgiven. (0 = Never)", FCVAR_PROTECTED, true, 0.0);
61+
g_penaltyType = CreateConVar("sm_vac_penalty_type", "1", "How to remove the player. 0 = kick, 1 = ban", FCVAR_PROTECTED, true, 0.0, true, 1.0);
6062
g_maxBanCount = CreateConVar("sm_vac_max_bans", "2", "The maximum forgivable number of old bans.", FCVAR_PROTECTED, true, 0.0);
6163
g_banLength = CreateConVar("sm_vac_ban_length", "-1", "Duration of server ban for VAC'd accounts. (In days. -1 = until 'max age', 0 = permanent)", FCVAR_PROTECTED, true, -1.0);
6264

@@ -199,12 +201,22 @@ public void BanCheckCallback(Handle req, bool failure, bool requestSuccessful, E
199201
#if defined DEBUG
200202
LogMessage("Would have banned '%L' for '%i' days.", client, banDuration / 1440);
201203
#else
202-
if (g_bSourceBansPP)
203-
SBPP_BanPlayer(0, client, banDuration, BAN_REASON);
204+
if (g_penaltyType.BoolValue)
205+
{
206+
if (g_bSourceBansPP)
207+
SBPP_BanPlayer(0, client, banDuration, BAN_REASON);
208+
else
209+
BanClient(client, banDuration, BANFLAG_AUTO, BAN_REASON, BAN_REASON, "sm_ban", _);
210+
211+
LogMessage("Banned '%L' for '%i' days.", client, banDuration / 1440);
212+
}
204213
else
205-
BanClient(client, banDuration, BANFLAG_AUTO, BAN_REASON, BAN_REASON, "sm_ban", _);
214+
{
215+
KickClient(client, BAN_REASON);
216+
217+
LogMessage("Kicked '%L'");
218+
}
206219

207-
LogMessage("Banned '%L' for '%i' days.", client, banDuration / 1440);
208220
#endif
209221
}
210222

Plugins/vac_check/updatefile.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
{
55
"Version"
66
{
7-
"Latest" "1.0.1"
7+
"Latest" "1.1.0"
88
}
99

10-
"Notes" "Shorten and improve ban message."
10+
"Notes" "Add 'sm_vac_penalty_type' convar which controls if player is banned (default) or kicked."
1111
}
1212

1313
"Files"

0 commit comments

Comments
 (0)