From 5f81bfa89954a84c886eaa0a12c48eedbb68dd0f Mon Sep 17 00:00:00 2001 From: Jim Shield Date: Sun, 17 Aug 2025 02:10:21 +0100 Subject: [PATCH] Add distExploitCheck function (will be used soon) I'm adding distance based exploit protection to stashes, shops and selling shops to help fight exploiters Soon all these created through jim_bridge will refuse opening if its not "registered" correctly Basically, all my scripts will get updates to support this --- shared/_authToken.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/shared/_authToken.lua b/shared/_authToken.lua index e8de386..901aa32 100644 --- a/shared/_authToken.lua +++ b/shared/_authToken.lua @@ -115,4 +115,30 @@ else debugPrint("^1Auth^7: ^2Clearing Auth Event^7") TriggerServerEvent(getScript()..":clearAuthEventRequest") end, true) +end + +function distExploitCheck(table, src) + + if not table then + --print("^1Error^7: ^1This wasn^7'^1t reigstered correctly or this is an exploit attempt^1") + return false + end + + local ped = src and GetPlayerPed(src) or PlayerPedId() + local srcCoords = GetEntityCoords(ped) + local allow = false + + for i = 1, #table do + if #(table[i] - srcCoords) <= 10 then + return true + else + allow = false + end + end + + if not allow then + debugPrint(src and ("^1Src ^3"..src.." ").."^1Tried to open a registered shop/stash from over the distance limit^7") + return false + end + end \ No newline at end of file