local max_players_per_ip = 2
function onThink(interval)
local ipList = {}
local players = getPlayersOnline()
for i, v in ipairs(players) do
local tmpPlayer = players[v]
local ip = getPlayerIpByName(getPlayerName(tmpPlayer))
if ip ~= 0 then
local list = ipList[ip]
if not list then
ipList[ip] = {}
list = ipList[ip]
end
list[#list + 1] = tmpPlayer
end
end
for ip, list in pairs(ipList) do
local listLength = #list
if listLength > max_players_per_ip then
local tmpPlayer = list[1]
for i = 2, listLength do
tmpPlayer = list[i]
doRemoveCreature(list[i])
end
end
end
return true
end