Credits to Bogart who posted the original on the forum!
The script was great, but there was one thing I didn't find appealing which was the fact it showed the FYI popup every time you logged in. So I made a slight modification to check if the player is at his limit first, then send a FYI for 2.5 seconds and kick them off. This way, the player has a short disclaimer so he knows why he got kicked, but its not repeated everytime they login without being at the limit.
I know there's really no point in posting this, but hopefully someone will find it useful.
Create creaturescripts/scripts/antimc.lua
Paste in creaturescripts/scripts/login.lua
Paste in creaturescripts/creaturescripts.xml
Image:
Regards,
Extrodus
The script was great, but there was one thing I didn't find appealing which was the fact it showed the FYI popup every time you logged in. So I made a slight modification to check if the player is at his limit first, then send a FYI for 2.5 seconds and kick them off. This way, the player has a short disclaimer so he knows why he got kicked, but its not repeated everytime they login without being at the limit.
I know there's really no point in posting this, but hopefully someone will find it useful.
Create creaturescripts/scripts/antimc.lua
Code:
local config = {
max = 3, -- Maximum Clients Allowed Connected
text = "Sorry, we only allow up to 3 Multi-Clients.", -- PopupFYI Text
group_id = 1 -- This will only kick players with Group 1 (Player)
}
local accepted_ip_list = "127.0.0.1" -- IP's allowed to MC
local function AntiMC(p)
if #getPlayersByIp(getPlayerIp(p.pid)) >= p.max then
doPlayerPopupFYI(p.pid, config.text)
addEvent(doRemoveCreature, 2500, 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
Paste in creaturescripts/scripts/login.lua
Code:
registerCreatureEvent(cid, "AntiMC")
Paste in creaturescripts/creaturescripts.xml
Code:
<event type="login" name="AntiMC" event="script" value="antimc.lua"/>
Image:
Regards,
Extrodus
Last edited: