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

Solved [Help(to fix||finish)] Anti Multi-Client(mc) feature [8.4]

ravockz

New Member
Joined
Jan 23, 2009
Messages
19
Reaction score
0
First of all, i'm sorry of my very first post is a help one, but i was retired with OTs...now i see this is the newest hotspot of c++ . . . so here we go! ;)


i was trying to figure out some sort of anti-mc in lua, cuz the codes i've find, i mean insource ones... are too old... :eek:

this should replace ur login.lua at creaturescripts/scripts. . . since i don't need a deathlist, it's a pvp-e(war) server. . .

This code isn't mine!! sorry i don't remember the author...i kind of found it lost in a random post. . . :confused:
function onLogin(cid)
local players = getOnlinePlayers()
local x = 1
if #players > 0 then
for player,v in ipairs(players) do
if getPlayerIp(player) == getPlayerIp(cid) then
x = x+1
end
end
if x > 2 then
doRemoveCreature(cid)
end
end
return TRUE
end

The problem is:
It's not working, and i have no clue whats wrong.


If someone got a Anti-MC system to spare, for lua, C++, for 8.4, or at least wanna gimme a helping tought how to create one or fix this one(i think its faster)


I'm waiting totally sad, cuz Mc's are ruining my war server. :(
 
Last edited:
This is supposed to work for TFS i guess:
Code:
function onLogin(cid)
	local players = getOnlinePlayers()
	if #players > 0 then
		for i, uid in ipairs(players) do
			if getIPByPlayerName(getPlayerName(cid)) == getIPByPlayerName(getPlayerName(uid)) then
				doRemoveCreature(cid)
			end
		end
	end
	return TRUE
end
Magich :D
 
So far i use TFS 0.3b3...

function onLogin(cid)
local players = getOnlinePlayers()
if #players > 0 then
for i, uid in ipairs(players) do
if getIPByPlayerName(getPlayerName(cid)) == getIPByPlayerName(getPlayerName(uid)) then
doRemoveCreature(cid)
end
end
end
return TRUE
end

In the GUI its sayin:
[25/01/2009 17:42:48] Lua Script Error: [CreatureScript Interface]
[25/01/2009 17:42:48] data/creaturescripts/scripts/login.lua:eek:nLogin

[25/01/2009 17:42:48] luaGetCreatureName(). Creature not found
[25/01/2009 17:42:53] Ravok has logged out.

I tested mc on localhost, so far not working...

i guess its de remove creature thing, cuz we are workin with players(i dunno nothin about lua, just tryin out)
 
Try with this:
Code:
function onLogin(cid)
	for _, _cid in ipairs(getOnlinePlayers()) do
		if getPlayerIp(cid) == getPlayerIp(_cid) then
			doRemoveCreature(cid)
		end
	end
	return TRUE
end

... and please, use code tags, not quote :mad:
 
@ Rudolf Czarodziej

hey,not working, no GUI msgs...no warnings, opens OK, but localhost and external players can both log in with 2 different characters at same time =/

i just don't have any clue how to do it now. . .
 
Also if you mean that 2 players can log in same character in 1 acc = config.lua

but what if the player got router;)?

Like when i got 2 computers, i can only go to servers with one of them, what if my brother wants to play but on the other computer(same ip)

what if you are in a internet café and playng with friends:)
 
@zonet, well i rather sacrifice ur brother, and lan players then sacrifice my whole server.

By the way i made it work now, so its solved, thanks all.
 
I dont quite get the problem, you want your brother to play on another computer on the same router? In that case you should look in config.lua if its not working to just connect.. I dont understand why Multi Client should be necessarily.
Here is what I would do:
Click on tibia on your desk and right-click and take.. I dont know what its called in English I will try to translate >.<
"Opportunities" And then you add gamemaster to your tibia position
"C:\Program\Tibia 8.30\Tibia.exe"gamemaster

JUST ADD GAMEMASTER with no spaces or anything!
 
I dont quite get the problem, you want your brother to play on another computer on the same router? In that case you should look in config.lua if its not working to just connect.. I dont understand why Multi Client should be necessarily.
Here is what I would do:
Click on tibia on your desk and right-click and take.. I dont know what its called in English I will try to translate >.<
"Opportunities" And then you add gamemaster to your tibia position
"C:\Program\Tibia 8.30\Tibia.exe"gamemaster

JUST ADD GAMEMASTER with no spaces or anything!
Thats what I think you should do!
 
Back
Top