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

CreatureEvent Anti Multi-Client

ravockz

New Member
Joined
Jan 23, 2009
Messages
19
Reaction score
0
Yes, it will block, router users, lan users whatever shares the same hub/router, the same IP.

i pretty much used the elf code to MC check, but since there is no code for this...i've added a little text aswell, here it is :

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

it's needing a little fix maybe, cuz sometimes for like 1 minute says that everybody got the same IP =X but after 1 min, works normally....
 
Yes, it will block, router users, lan users whatever shares the same hub/router, the same IP.

i pretty much used the elf code to MC check, but since there is no code for this...i've added a little text aswell, here it is :

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

it's needing a little fix maybe, cuz sometimes for like 1 minute says that everybody got the same IP =X but after 1 min, works normally....


Didn't work in my Actions.Lua / Xml
 
@up: Actions?!?!?!?!?!?!?!?!


-> anyone can fix the script, i need it for my war server ^^
 
Mmm.. a question..

I have a brother that play tibia too.. he have her own computer but.. her computer and my computer have the same IP because is the same internet. The MC-Check will block us?
 
Mmm.. a question..

I have a brother that play tibia too.. he have her own computer but.. her computer and my computer have the same IP because is the same internet. The MC-Check will block us?

yea, routers :)
 
Can anyone make this work perfect without script errors for the latest tfs?
 
Code:
	if(table.maxn(list) > 0) then
		for pid, ip in pairs(list) do
		doPlayerPopupFYI(cid, text)
		doRemoveCreature(cid)
	end

Change 'cid' to 'pid'. :S
 
#Up
Code:
	if(table.maxn(list) > 0) then
		for pid, ip in pairs(list) do
		doPlayerPopupFYI(cid, text)
		doRemoveCreature(cid)
	end

Cuz we have pid parameter in "for"?
 
But we want to send message to login player, not to player who is already in game?

Anyway, faster way to do anti mc login:
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
 
hmm go to data-->creaturescript-->scripts and create a file and paste the 2 scripts up in it, then go to creature.xml and paste these 2 lines
Code:
<event type="login" name="lol" event="script" value="xxx.lua"/>
<event type="logout" name="lol" event="script" value="xxx.lua"/>
in the xxx right the name of the lua file you created
 
Back
Top