diff options
| author | aura <nw@moneybot.cc> | 2026-02-17 23:42:09 +0100 |
|---|---|---|
| committer | aura <nw@moneybot.cc> | 2026-02-17 23:42:09 +0100 |
| commit | 5e2eb7d67ae933b7566f1944d0bb7744da03d586 (patch) | |
| tree | 054acff1113270a9cd07933df760f3768c1b6853 /source/sourcemod/scripting/gokz-global/ban_player.sp | |
| parent | 341db13a008dc12bb22ceb50452d93d01476308c (diff) | |
move source stuff to its own folder
Diffstat (limited to 'source/sourcemod/scripting/gokz-global/ban_player.sp')
| -rw-r--r-- | source/sourcemod/scripting/gokz-global/ban_player.sp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/source/sourcemod/scripting/gokz-global/ban_player.sp b/source/sourcemod/scripting/gokz-global/ban_player.sp new file mode 100644 index 0000000..835d9e5 --- /dev/null +++ b/source/sourcemod/scripting/gokz-global/ban_player.sp @@ -0,0 +1,42 @@ +/* + Globally ban players when they are suspected by gokz-anticheat. +*/ + + + +// =====[ PUBLIC ]===== + +void GlobalBanPlayer(int client, ACReason reason, const char[] notes, const char[] stats) +{ + char playerName[MAX_NAME_LENGTH], steamid[32], ip[32]; + + GetClientName(client, playerName, sizeof(playerName)); + GetClientAuthId(client, AuthId_Steam2, steamid, sizeof(steamid)); + GetClientIP(client, ip, sizeof(ip)); + + DataPack dp = new DataPack(); + dp.WriteString(playerName); + dp.WriteString(steamid); + + switch (reason) + { + case ACReason_BhopHack:GlobalAPI_CreateBan(BanPlayerCallback, dp, steamid, "bhop_hack", stats, notes, ip); + case ACReason_BhopMacro:GlobalAPI_CreateBan(BanPlayerCallback, dp, steamid, "bhop_macro", stats, notes, ip); + } +} + +public int BanPlayerCallback(JSON_Object response, GlobalAPIRequestData request, DataPack dp) +{ + char playerName[MAX_NAME_LENGTH], steamid[32]; + + dp.Reset(); + dp.ReadString(playerName, sizeof(playerName)); + dp.ReadString(steamid, sizeof(steamid)); + delete dp; + + if (request.Failure) + { + LogError("Failed to globally ban %s (%s).", playerName, steamid); + } + return 0; +} |
