• 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 Anty MC

zielok

New Member
Joined
Mar 8, 2009
Messages
66
Reaction score
0
Code:
function onLogin(cid)
  if #getPlayersByIp(getPlayerIp(cid)) >= 3 then
    return FALSE
  end
  return TRUE
end


How to edit this script so it's executed 1 second after login? because if you use a mage bomb it's possible to login more characters... (every time you magebomb it's possible to login one character, so there will 3,4,5 etc with the same IP)
 
This is bad.
What if you go on LAN party together with your friends and want to play the server?

They will switch to another server since they cant all be online at the same time.

That does not prevent MCing, it prevents players from logging in with the same IP.

A way to prevent MC would be to create a custom client without the MC function, that a regulary MC patcher cant patch. And force players to use the custom client instead of the regular Tibia client.
 
This is bad.
What if you go on LAN party together with your friends and want to play the server?

They will switch to another server since they cant all be online at the same time.

That does not prevent MCing, it prevents players from logging in with the same IP.

A way to prevent MC would be to create a custom client without the MC function, that a regulary MC patcher cant patch. And force players to use the custom client instead of the regular Tibia client.

its always possible to patch that >.>
 
Code:
local function gtfoMC(cid, p)
	if #getPlayersByIp(getPlayerIp(cid)) >= p then
		doRemoveCreature(cid)
	end

        return TRUE
end

function onLogin(cid)
	addEvent(gtfoMC, 1000, cid, 3)
	
	return TRUE
end
 
@Znote and Master-m

If your server doesn't have much players you can use this script so you can add manually accepted IP adresses. LAN networks usually have static IP adresses. It's much better to allow them logging it instead of forcing to use your own client...

Code:
local accept_ips = {'123.123.123', '1.1.11'}

function onLogin(cid)
	if #getPlayersByIp(getPlayerIp(cid)) >= 3 then
		local ip = doConvertIntegerToIp(getPlayerIp(cid))
		for i = 1, #accept_ips do
			if ip == accept_ips[i] then
				return TRUE
			end
		end
		return FALSE
	end
	return TRUE
end
 
Code:
local function gtfoMC(cid, p)
	if #getPlayersByIp(getPlayerIp(cid)) >= p then
		doRemoveCreature(cid)
	end

        return TRUE
end

function onLogin(cid)
	addEvent(gtfoMC, 1000, cid, 3)
	
	return TRUE
end

Sry, Rudolf, but your script crashes server ;/
 
I think its better to get the peoples ip when they login and check if they login on multiple chars within 5 seconds, if that is true then you kick them.
 
PHP:
local function gtfoMC(p)
	if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then
		doRemoveCreature(p.pid)
	end
        return TRUE
end

function onLogin(cid)
	addEvent(gtfoMC, 1000, {pid = cid, max = 3})
	return TRUE
end
 
Here is my Anti MC script :thumbup:.

create a AntiMC.lua in
data/creaturescripts/scripts/
Lua:
--[[
     Anti MC
     by Shawak
]]--

local config = {
	max = 1,     -- max chars with the same ip
	text = "Multi-Client is not allowed.",  -- text on kick
	group_id = 1  -- only kick player with group id 1 (normal players)
}

local accepted_ip_list = {}    -- list of ip's then can use MC

local function antiMC(p)
	if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then
        	doRemoveCreature(p.pid)
	end
	return TRUE
end

function onLogin(cid)
	if getPlayerGroupId(cid) <= config.group_id then
		if isInArray(accepted_ip_list,getPayerIp(cid)) == FALSE then 
			addEvent(antiMC, 1000, {pid = cid, max = config.max+1})
			doPlayerPopupFYI(cid, config.text)
		end
	end
	return TRUE
end

EDIT:

data/creaturescripts/creaturescripts.xml
Lua:
	<event type="login" name="AntiMC" event="script" value="antiMc.lua"/>

Not Tested (I changed some things before i posted)
I don't worry about a Rep++.

Regards,
Shawak
 
Here is my Anti MC script :thumbup:.

create a AntiMC.lua in
data/creaturescripts/scripts/
Lua:
--[[
     Anti MC
     by Shawak
]]--

local config = {
	max = 1,     -- max chars with the same ip
	text = "Multi-Client is not allowed.",  -- text on kick
	group_id = 1  -- only kick player with group id 1 (normal players)
}

local accepted_ip_list = {}    -- list of ip's then can use MC

local function antiMC(p)
	if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then
        	doRemoveCreature(p.pid)
	end
	return TRUE
end

function onLogin(cid)
	if getPlayerGroupId(cid) <= config.group_id then
		if isInArray(accepted_ip_list,getPayerIp(cid)) == FALSE then 
			addEvent(antiMC, 1000, {pid = cid, max = config.max+1})
			doPlayerPopupFYI(cid, config.text)
		end
	end
	return TRUE
end

EDIT:

data/creaturescripts/creaturescripts.xml
Lua:
	<event type="login" name="AntiMC" event="script" value="antiMc.lua"/>

Not Tested (I changed some things before i posted)
I don't worry about a Rep++.

Regards,
Shawak

When you add the event why using local on the function ?
Explain :p
 
Here is my Anti MC script :thumbup:.

create a AntiMC.lua in
data/creaturescripts/scripts/
Lua:
--[[
     Anti MC
     by Shawak
]]--

local config = {
	max = 1,     -- max chars with the same ip
	text = "Multi-Client is not allowed.",  -- text on kick
	group_id = 1  -- only kick player with group id 1 (normal players)
}

local accepted_ip_list = {}    -- list of ip's then can use MC

local function antiMC(p)
	if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then
        	doRemoveCreature(p.pid)
	end
	return TRUE
end

function onLogin(cid)
	if getPlayerGroupId(cid) <= config.group_id then
		if isInArray(accepted_ip_list,getPayerIp(cid)) == FALSE then 
			addEvent(antiMC, 1000, {pid = cid, max = config.max+1})
			doPlayerPopupFYI(cid, config.text)
		end
	end
	return TRUE
end

EDIT:

data/creaturescripts/creaturescripts.xml
Lua:
	<event type="login" name="AntiMC" event="script" value="antiMc.lua"/>

Not Tested (I changed some things before i posted)
I don't worry about a Rep++.

Regards,
Shawak


[12/06/2009 16:01:26] data/creaturescripts/scripts/antiMc.lua:23: attempt to call global 'getPayerIp' (a nil value)
[12/06/2009 16:01:26] stack traceback:
[12/06/2009 16:01:26] data/creaturescripts/scripts/antiMc.lua:23: in function <data/creaturescripts/scripts/antiMc.lua:21>
 
if someone magebombed ur server, and u used this, wouldnt it crash ur ot since the magebomb keeps trying to login and u keep logging them out with this script?
 
well it works but elf should fix the spell spam bug cuz if many players with different ip login there's nothing to do
 
But accepted_ip_list not function.

change:
if isInArray(accepted_ip_list,getPayerIp(cid)) == FALSE then

TO:
if isInArray(accepted_ip_list,doConvertIntegerToIp(getPlayerIp(cid))) == FALSE then

in accepted_ip_list = {}

add the ips, example: accepted_ip_list = {"200.85.3.60", "201.36.5.222"}

:thumbup:
 
Back
Top