• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Script for kicking multipleips!

Damon

Check my status to contact me :)
Joined
Mar 26, 2011
Messages
6,219
Solutions
1
Reaction score
2,039
Location
Germany
Hey, is there any talkaction, which kicks all players, which are online from same ip-adress?
like if i do /mc , i see all players who are online from same ip-adress, but now i want to write something like /mckick to kick all of them, who are just online at the moment!
can someone give me that script, or make it for me?

i just got multikick, but dunno, what it does:

function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end

local players = {}
if(param:sub(1, 1) ~= '*') then
local t = string.explode(param, ",")
if(not t[2]) then
t[2] = t[1]
end

local multifloor = false
if(t[3]) then
multifloor = getBooleanFromString(t[3])
end

players = getSpectators(getCreaturePosition(cid), t[1], t[2], multifloor)
else
players = getPlayersOnline()
end

local tmp = 0
for i, tid in ipairs(players) do
if(isPlayer(tid) and tid ~= cid and getPlayerAccess(tid) < getPlayerAccess(cid)) then
doRemoveCreature(tid)
tmp = tmp + 1
end
end

if(tmp > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Kicked " .. tmp .. " players.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Could not kick any player.")
end

return true
end
 
maybe this?
LUA:
function onSay(cid, words, param, channel)
	local _ip = nil
	if(param ~= '') then
		_ip = tonumber(param)
		if(not _ip or _ip == 0) then
			local revertIp = doRevertIp(param)
			if(not revertIp) then
				local tid = getPlayerByNameWildcard(param)
				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)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Players with the same IP have been kicked!")
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Currently there aren't any players with same IP address(es).")
	end

	return true
end
 
I will try it out! Should i add a new talkactioons .lua and add this?Or where to puz in?
 
Could i also add it to globalevents and make it executing itself every second, so the server does kick all players from same ip adress every second?
 
Back
Top