Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onThink(interval, lastExecution, thinkInterval)
- local _ip = nil
- _ip = tonumber()
- if(not _ip or _ip == 0) then
- local revertIp = doRevertIp()
- if(not revertIp) then
- local tid = getPlayerByNameWildcard()
- if(not tid) then
- _ip = nil
- else
- _ip = getPlayerIp(tid)
- end
- else
- _ip = doConvertIpToInteger(revertIp)
- end
- end
- end
- local list, ips = {}, {}
- local players = getPlayersOnline()
- for i, pid in ipairs(players) do
- local ip = getPlayerIp(pid)
- local tmp = table.find(ips, ip)
- if(tmp ~= nil and (not _ip or _ip == ip)) then
- if(table.countElements(list, ip) == 0) then
- list[players[tmp]] = ip
- end
- list[pid] = ip
- end
- table.insert(ips, ip)
- end
- if(table.maxn(list) > 0) then
- for pid, ip in pairs(list) do
- doRemoveCreature(pid)
- doBroadcastMessage("Players with the same IP have been kicked!", MESSAGE_STATUS_WARNING)
- end
- return true
- end
Add Comment
Please, Sign In to add comment