• 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!

Login check IP - If same, dont let log in.

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,766
Solutions
1
Reaction score
225
Location
Chile, Santiago
Can someone make something that when you log in, it checks your IP, and if it already loged on, it wont let you log in.
 
Code:
function onLogin(cid)
	local list = {}
	local ips = {}
	local text = "MULTI-CLIENTING IS BLOCKED."
	local players = getPlayersOnline()
	for i, pid in ipairs(players) do
		local ip = getPlayerIp(pid)
		local tmp = table.find(ips, ip)
		if(tmp ~= nil) 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
		doPlayerPopupFYI(cid, text)
		doRemoveCreature(cid)
		end
end
	return TRUE
end

Original post: http://otland.net/f82/anti-multi-client-21421/
 
OnLogin
Code:
MC_loggedIPs = {}
MC_kicked = {}

function onLogin(cid, lastLogin)
	local playerIP = getPlayerIp(cid)
	if(MC_loggedIPs[playerIP] ~= nil) then
		MC_kicked[cid] = TRUE
		doPlayerPopupFYI(cid, "MC Is blocked!")
		doRemoveCreature(cid)
		return TRUE
	end

	MC_loggedIPs[playerIP] = TRUE
	return TRUE
end

onLogout
Code:
function onLogout(cid)
	if(MC_kicked[cid] == TRUE) then
		return TRUE
	end

	local playerIP = getPlayerIp(cid)
	if(_G["MC_loggedIPs"][playerIP] ~= nil) then
		_G["MC_loggedIPs"][playerIP] = nil
	end
	return TRUE
end
Not sure if it works
 
Last edited:
Back
Top