MaXwEllDeN

getPlayersWithSameIp

Apr 19th, 2013
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.41 KB | None | 0 0
  1. function getPlayersWithSameIp() -- By MaXwEllDeN
  2.     local groups = {}
  3.    
  4.     for _, cid in pairs(getPlayersOnline()) do
  5.         local aux = {}
  6.         table.insert(aux, cid)
  7.        
  8.         for _, uid in pairs(getPlayersOnline()) do
  9.             if getPlayerIp(cid) == getPlayerIp(uid) and not isInArray(aux, uid) then
  10.                 table.insert(aux, uid)
  11.             end
  12.         end
  13.        
  14.         if #aux > 1 then
  15.             table.insert(groups, aux)
  16.         end
  17.     end
  18.    
  19.     return groups
  20. end
Advertisement
Add Comment
Please, Sign In to add comment