Sun
Knowledge is power - France is bacon
- Joined
- Jan 26, 2015
- Messages
- 333
- Solutions
- 22
- Reaction score
- 244
Hello. The "accepted_ip_list" is not working in this ani mc script I'm using
I think this part needs to be edited so it check if an ip is in the accepted list first or not, but I'm not sure how to do it (I tried but failed)
The whole script
I think this part needs to be edited so it check if an ip is in the accepted list first or not, but I'm not sure how to do it (I tried but failed)
Code:
local function antiMC(p)
if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then
doRemoveCreature(p.pid)
end
return TRUE
end
The whole script
Code:
local config = {
max = 3,
group_id = 1 -- it will only kick player whit that id (1=Players, 2=tutor, 3=seniortutors, 4=Gm's, 5=Cm's and 6=God's
}
local accepted_ip_list = {"127.0.0.1", "xx.xxx.xxx.xx"} -- the Ip's entered here are allowed to use Mc/Magebomb..
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, 1000, {pid = cid, max = config.max+1})
end
end
return TRUE
end