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