Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RegisterServerEvent('esx_identify:hackCheck')
- AddEventHandler('esx_identify:hackCheck', function(ply, myID, lastCoords, newCoords, distance)
- TriggerClientEvent("esx_identify:sendNotification", -1, ply, '^1Initiating distance checks.')
- if distance > 150 then
- TriggerClientEvent("esx_identify:sendNotification", -1, ply, '^1Distance was greater than 150.')
- local isIPL = false
- for k, v in pairs(IPLAreas) do
- entranceDistanceLast = TriggerClientEvent("esx_identify:GetDistanceBetweenCoords", -1, ply, lastCoords.x, lastCoords.y, lastCoords.z, IPLAreas[k].entranceX, IPLAreas[k].entranceY, IPLAreas[k].entranceZ)
- entranceDistanceNew = TriggerClientEvent("esx_identify:GetDistanceBetweenCoords", -1, ply, newCoords.x, newCoords.y, newCoords.z, IPLAreas[k].entranceX, IPLAreas[k].entranceY, IPLAreas[k].entranceZ)
- exitDistanceLast = TriggerClientEvent("esx_identify:GetDistanceBetweenCoords", -1, ply, lastCoords.x, lastCoords.y, lastCoords.z, IPLAreas[k].exitX, IPLAreas[k].exitY, IPLAreas[k].exitZ)
- exitDistanceNew = TriggerClientEvent("esx_identify:GetDistanceBetweenCoords", -1, ply, newCoords.x, newCoords.y, newCoords.z, IPLAreas[k].exitX, IPLAreas[k].exitY, IPLAreas[k].exitZ)
- -- entranceDistanceLast = GetDistanceBetweenCoords(lastCoords.x, lastCoords.y, lastCoords.z, IPLAreas[k].entranceX, IPLAreas[k].entranceY, IPLAreas[k].entranceZ, true)
- -- entranceDistanceNew = GetDistanceBetweenCoords2(newCoords.x, newCoords.y, newCoords.z, IPLAreas[k].entranceX, IPLAreas[k].entranceY, IPLAreas[k].entranceZ, true)
- -- exitDistanceLast = GetDistanceBetweenCoords3(lastCoords.x, lastCoords.y, lastCoords.z, IPLAreas[k].exitX, IPLAreas[k].exitY, IPLAreas[k].exitZ, true)
- -- exitDistanceNew = GetDistanceBetweenCoords4(newCoords.x, newCoords.y, newCoords.z, IPLAreas[k].exitX, IPLAreas[k].exitY, IPLAreas[k].exitZ, true)
- if ((entranceDistanceLast < 200) or (entranceDistanceNew < 200)) and ((exitDistanceLast < 200) or (exitDistanceNew < 200)) then
- isIPL = true
- break
- end
- end
- if isIPL == false then
- TriggerClientEvent("esx_identify:sendNotification", -1, ply, '^1isIPL was false. Triggering Kick.')
- local name = getIdentity(source)
- if name.group ~= 'admin' then
- TriggerEvent("esx_identify:kick", myID, "Using Teleport Hacks")
- TriggerClientEvent("esx_identify:sendNotification", -1, ply, '^1Player ' .. tostring(myID) .. ': ^4' .. name.firstname .. ' ' .. name.lastname .. ' ^1kicked for possible Teleportation hacks.')
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement