Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.49 KB | None | 0 0
  1. RegisterServerEvent('esx_identify:hackCheck')
  2. AddEventHandler('esx_identify:hackCheck', function(ply, myID, lastCoords, newCoords, distance)
  3.     TriggerClientEvent("esx_identify:sendNotification", -1, ply, '^1Initiating distance checks.')
  4.     if distance > 150 then
  5.         TriggerClientEvent("esx_identify:sendNotification", -1, ply, '^1Distance was greater than 150.')
  6.         local isIPL = false
  7.         for k, v in pairs(IPLAreas) do
  8.             entranceDistanceLast    = TriggerClientEvent("esx_identify:GetDistanceBetweenCoords", -1, ply, lastCoords.x, lastCoords.y, lastCoords.z, IPLAreas[k].entranceX, IPLAreas[k].entranceY, IPLAreas[k].entranceZ)
  9.             entranceDistanceNew     = TriggerClientEvent("esx_identify:GetDistanceBetweenCoords", -1, ply, newCoords.x, newCoords.y, newCoords.z, IPLAreas[k].entranceX, IPLAreas[k].entranceY, IPLAreas[k].entranceZ)
  10.             exitDistanceLast        = TriggerClientEvent("esx_identify:GetDistanceBetweenCoords", -1, ply, lastCoords.x, lastCoords.y, lastCoords.z, IPLAreas[k].exitX, IPLAreas[k].exitY, IPLAreas[k].exitZ)
  11.             exitDistanceNew         = TriggerClientEvent("esx_identify:GetDistanceBetweenCoords", -1, ply, newCoords.x, newCoords.y, newCoords.z, IPLAreas[k].exitX, IPLAreas[k].exitY, IPLAreas[k].exitZ)
  12.             -- entranceDistanceLast     = GetDistanceBetweenCoords(lastCoords.x, lastCoords.y, lastCoords.z, IPLAreas[k].entranceX, IPLAreas[k].entranceY, IPLAreas[k].entranceZ, true)
  13.             -- entranceDistanceNew      = GetDistanceBetweenCoords2(newCoords.x, newCoords.y, newCoords.z, IPLAreas[k].entranceX, IPLAreas[k].entranceY, IPLAreas[k].entranceZ, true)
  14.             -- exitDistanceLast         = GetDistanceBetweenCoords3(lastCoords.x, lastCoords.y, lastCoords.z, IPLAreas[k].exitX, IPLAreas[k].exitY, IPLAreas[k].exitZ, true)
  15.             -- exitDistanceNew      = GetDistanceBetweenCoords4(newCoords.x, newCoords.y, newCoords.z, IPLAreas[k].exitX, IPLAreas[k].exitY, IPLAreas[k].exitZ, true)
  16.             if ((entranceDistanceLast < 200) or (entranceDistanceNew < 200)) and ((exitDistanceLast < 200) or (exitDistanceNew < 200)) then
  17.                 isIPL = true
  18.                 break
  19.             end
  20.         end
  21.        
  22.         if isIPL == false then
  23.                 TriggerClientEvent("esx_identify:sendNotification", -1, ply, '^1isIPL was false. Triggering Kick.')
  24.             local name = getIdentity(source)
  25.             if name.group ~= 'admin' then
  26.                 TriggerEvent("esx_identify:kick", myID, "Using Teleport Hacks")
  27.                 TriggerClientEvent("esx_identify:sendNotification", -1, ply, '^1Player ' .. tostring(myID) .. ': ^4' .. name.firstname .. ' ' .. name.lastname .. ' ^1kicked for possible Teleportation hacks.')
  28.             end
  29.         end    
  30.     end
  31. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement