From bc95a864b9ff147d973c4e52e70dc061b1b49742 Mon Sep 17 00:00:00 2001 From: Lionh34rt <76415140+Lionh34rt@users.noreply.github.com> Date: Mon, 6 Jun 2022 03:34:48 +0200 Subject: [PATCH] ExploitBan export This export allows you to use it any script for exploit checks. Instead of having to define the function in multiple scripts like: exports['qb-core']:ExploitBan(source, "pawn-shop") https://github.com/qbcore-framework/qb-pawnshop/commit/8e81307cbabc3607fe4a82f88abf13765b35cf2f --- server/exports.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/server/exports.lua b/server/exports.lua index 2cfed5a..9f7b5c1 100644 --- a/server/exports.lua +++ b/server/exports.lua @@ -152,3 +152,19 @@ local function GetCoreVersion(InvokingResource) end QBCore.Functions.GetCoreVersion = GetCoreVersion exports('GetCoreVersion', GetCoreVersion) + +local function ExploitBan(playerId, origin) + local name = GetPlayerName(playerId) + MySQL.insert('INSERT INTO bans (name, license, discord, ip, reason, expire, bannedby) VALUES (?, ?, ?, ?, ?, ?, ?)', { + name, + QBCore.Functions.GetIdentifier(playerId, 'license'), + QBCore.Functions.GetIdentifier(playerId, 'discord'), + QBCore.Functions.GetIdentifier(playerId, 'ip'), + origin, + 2147483647, + 'Anti Cheat' + }) + DropPlayer(playerId, "You have been banned for cheating. Check our Discord for more information: " .. QBCore.Config.Server.Discord) + TriggerEvent("qb-log:server:CreateLog", "anticheat", "Anti-Cheat", "red", name.." has been banned for exploiting "..origin, true) +end +exports('ExploitBan', ExploitBan)