mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-17 05:56:02 +01:00
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
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user