--[[
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,getPlayerIp(cid)) == FALSE then
addEvent(antiMC, 1000, {pid = cid, max = config.max+1})
doPlayerPopupFYI(cid, config.text)
end
end
return TRUE
end
<event type="login" name="AntiMC" event="script" value="antiMc.lua"/>
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 = 2})
return TRUE
end
local config = {
seconds = 15, -- in seconds
onlyWithSameIP = "yes" -- will work for all players ("no"), or only check player with same IP? ("yes")
}
--DONT MODIFY
config.onlyWithSameIP = getBooleanFromString(config.onlyWithSameIP)
local m_lastLogin, m_lastIP = 0, 0
function onLogin(cid)
local timeNow, playerIP = os.time(), getPlayerIp(cid)
if(m_lastLogin + config.seconds >= timeNow and
(config.onlyWithSameIP == FALSE or m_lastIP == playerIP)) then
return FALSE
end
m_lastIP = playerIP
m_lastLogin = timeNow
return TRUE
end
Lua Script Error: [CreatureScript Interface]
in a timer event called from:
data/creaturescripts/scripts/antiMc.luanLogin
internalGetPlayerInfo(). Player not found