Action Modifi Anti MC(solved)

StormRusher

New Member
Joined
Dec 23, 2009
Messages
138
Best answers
0
Reaction score
0
well i have this anti-mc script

PHP:
local serverNameInScroll = getConfigInfo('serverNameInScroll')

local config = {
        max = 0,     -- max chars with the same ip
        text = "Multi-Client is not allowed in "..serverNameInScroll.."!",  -- 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,getPlayerIp(cid)) == FALSE then
                        addEvent(antiMC, 250, {pid = cid, max = config.max+1})
			doPlayerPopupFYI(cid, "You have been kicked because you are using Multi-Client.")
                end
        end
        return TRUE
end

But the problem is, with it the players can abuse and leave for a trap or something like, he have a char traped, then he log a mc and both chars are kiked

I want this script only kick the char what have pz locked, so he cannot flee of a trap.
 
Last edited:

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
Bottom Part

Code:
function onLogin(cid) 
    if (getPlayerGroupId(cid) <= config.group_id) then 
        if (isInArray(accepted_ip_list,getPlayerIp(cid)) == FALSE) then
            if (isPlayerPzLocked(cid) == false) then
                addEvent(antiMC, 250, {pid = cid, max = config.max+1}) 
		doPlayerPopupFYI(cid, "You have been kicked because you are using Multi-Client.") 
            end
	end
    end 
    return TRUE 
end
 

otaf

New Member
Joined
Aug 5, 2009
Messages
135
Best answers
0
Reaction score
1
where can i add it! i want this!

<action itemid="1770" script="anticmc.lua" />
 
OP
S

StormRusher

New Member
Joined
Dec 23, 2009
Messages
138
Best answers
0
Reaction score
0
thanks a lot JDB
works perfectly rep+


Ps: where did you get this condition? isPlayerPzLocked(cid)
i search on forum but i cant found a list with all conditions,actions
 
Last edited:
OP
S

StormRusher

New Member
Joined
Dec 23, 2009
Messages
138
Best answers
0
Reaction score
0
How can i make a condition? (i am begginer on it hehe)

Another thing,
its possible to teleport the player to a random position:
PHP:
{x=562 y=368 z=7}
{x=566 y=369 z=7}
{x=569 y=368 z=7}
{x=571 y=369 z=7}
{x=574 y=369 z=7}
before kick the player?
 

Last Knight

Lua Scripter
Joined
Dec 29, 2008
Messages
17
Best answers
0
Reaction score
0
Well, For does that will use this script im warning you that Cybers wont be able to play your ot cuz probably they will have the same ip address. Also with the brother(s)/sister(s) of a player on your game.

I'm right isn't? ( if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then)

Yours Last Knight.
 
OP
S

StormRusher

New Member
Joined
Dec 23, 2009
Messages
138
Best answers
0
Reaction score
0
For that the player who wants to play in lan or with someone with the same ip i'll set his char group 2, then the script will only kick players with group 1. I think it will work.

Someone can help me with the random teleport? =x
 

otaf

New Member
Joined
Aug 5, 2009
Messages
135
Best answers
0
Reaction score
1
i get errors on the consol

[29/12/2009 09:47:58] Lua Script Error: [CreatureScript Interface]
[29/12/2009 09:47:58] data/creaturescripts/scripts/login.lua:eek:nLogin

[29/12/2009 09:47:58] data/creaturescripts/scripts/login.lua:47: attempt to concatenate local 'serverNameInScroll' (a nil value)
[29/12/2009 09:47:58] stack traceback:
[29/12/2009 09:47:58] data/creaturescripts/scripts/login.lua:47: in function <data/creaturescripts/scripts/login.lua:5>
[29/12/2009 09:47:58] GM Best has logged out.
[29/12/2009 09:47:59] GM Best has logged in.

[29/12/2009 09:47:59] Lua Script Error: [CreatureScript Interface]
[29/12/2009 09:47:59] data/creaturescripts/scripts/login.lua:eek:nLogin

[29/12/2009 09:47:59] data/creaturescripts/scripts/login.lua:47: attempt to concatenate local 'serverNameInScroll' (a nil value)
[29/12/2009 09:47:59] stack traceback:
[29/12/2009 09:47:59] data/creaturescripts/scripts/login.lua:47: in function <data/creaturescripts/scripts/login.lua:5>
[29/12/2009 09:47:59] GM Best has logged out.
 

drax skylon

o.O DrAx O.o
Joined
Sep 9, 2008
Messages
225
Best answers
0
Reaction score
3
How can i make a condition? (i am begginer on it hehe)

Another thing,
its possible to teleport the player to a random position:
PHP:
{x=562 y=368 z=7}
{x=566 y=369 z=7}
{x=569 y=368 z=7}
{x=571 y=369 z=7}
{x=574 y=369 z=7}
before kick the player?
try it:

Code:
local serverNameInScroll = getConfigInfo('serverNameInScroll') 

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

local accepted_ip_list = {}    -- list of ips then can use MC 

local newpos = {
	{fromPos = {x=280, y=304, z=0}, toPos = {x=384, y=507, z=0}}
}

local function antiMC(p) 
        if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then 
                doTeleportThing(p.pid, newpos, TRUE) 
                doRemoveCreature(p.pid)

        end 
        return TRUE 
end 

function onLogin(cid) 
        if getPlayerGroupId(cid) <= config.group_id then 
                if isInArray(accepted_ip_list,getPlayerIp(cid)) == FALSE then 
                        addEvent(antiMC, 250, {pid = cid, max = config.max+1}) 
            doPlayerPopupFYI(cid, "You have been kicked because you are using Multi-Client.") 
                end 
        end 
        return TRUE 
end
Change it to your positions:

Code:
	{fromPos = {x=280, y=304, z=0}, toPos = {x=384, y=507, z=0}}
Hope it work!
PS: Not tested...:D
 
OP
S

StormRusher

New Member
Joined
Dec 23, 2009
Messages
138
Best answers
0
Reaction score
0
thx drak, i dont tested you script but i have some ideas with it.

i completed the script:

the script teleport the MC char to a random position (position), then kill the player.

NOTE: i dont know but the script wasnt working right with max = 0, so i put = 1 and works, if someone knows please tell me :D

Lua:
local config = {
	max = 1,     -- max chars with the same ip
	text = "Você foi morto por usar MC. Agora clique em OK e depois em Cancel.", -- message when the player is dead
        group_id = 1,
	position = {{x=562, y=368, z=7}, {x=566, y=369, z=7}, {x=569, y=368, z=7}, {x=571, y=369, z=7}, {x=574, y=369, z=7}}
}

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

local randomChance = math.random(1,5)


local function antiMC(p)
        if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then
		if (isPlayerPzLocked(p.pid) == false) then
		doTeleportThing(p.pid, config.position[randomChance])
		doPlayerPopupFYI(p.pid, config.text) 
         	doCreatureAddHealth(p.pid, -getCreatureHealth(p.pid))
		end
        end
        return TRUE
end

function onLogin(cid) 
    if (getPlayerGroupId(cid) <= config.group_id) then 
        if (isInArray(accepted_ip_list,getPlayerIp(cid)) == FALSE) then
            if (isPlayerPzLocked(cid) == false) then
                addEvent(antiMC, 2000, {pid = cid, max = config.max+1}) 
            end
	end
    end 
    return TRUE 
end
 

drax skylon

o.O DrAx O.o
Joined
Sep 9, 2008
Messages
225
Best answers
0
Reaction score
3
thx drak, i dont tested you script but i have some ideas with it.

i completed the script:

the script teleport the MC char to a random position (position), then kill the player.

NOTE: i dont know but the script wasnt working right with max = 0, so i put = 1 and works, if someone knows please tell me :D

Lua:
local config = {
	max = 1,     -- max chars with the same ip
	text = "Você foi morto por usar MC. Agora clique em OK e depois em Cancel.", -- message when the player is dead
        group_id = 1,
	position = {{x=562, y=368, z=7}, {x=566, y=369, z=7}, {x=569, y=368, z=7}, {x=571, y=369, z=7}, {x=574, y=369, z=7}}
}

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

local randomChance = math.random(1,5)


local function antiMC(p)
        if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then
		if (isPlayerPzLocked(p.pid) == false) then
		doTeleportThing(p.pid, config.position[randomChance])
		doPlayerPopupFYI(p.pid, config.text) 
         	doCreatureAddHealth(p.pid, -getCreatureHealth(p.pid))
		end
        end
        return TRUE
end

function onLogin(cid) 
    if (getPlayerGroupId(cid) <= config.group_id) then 
        if (isInArray(accepted_ip_list,getPlayerIp(cid)) == FALSE) then
            if (isPlayerPzLocked(cid) == false) then
                addEvent(antiMC, 2000, {pid = cid, max = config.max+1}) 
            end
	end
    end 
    return TRUE 
end
If you kill the player after he gets teleported to a random position he will appear in temple right? so you do not need teleport him to a random position, you can just kill him and he will be automatically teleported to temple ;]

In other words you can remove this line:
doTeleportThing(p.pid, config.position[randomChance])
:thumbup:
 

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,772
Best answers
1
Reaction score
210
Location
Chile, Santiago
So this script teleport the MC to a random place, then it get killed and teleported to temple?
 
Top