local AccPorIp = 5
function onLogin(player)
local mc = 0
for _, verificar in ipairs(Game.getPlayers()) do
if player:getIp() == verificar:getIp() then
mc = mc + 1
if mc > AccPorIp then return false end
end
end
return true
end
Maybe something like this:
In init.lua
if g_platform.isProcessRunning("name") then
g_logger.fatal('mc')
end
Or check luafunctions.cpp there is more such functions that you looking for.
Code:local AccPorIp = 5 function onLogin(player) local mc = 0 for _, verificar in ipairs(Game.getPlayers()) do if player:getIp() == verificar:getIp() then mc = mc + 1 if mc > AccPorIp then return false end end end return true end
You can use this script to set a max connection per ip. I wouldnt make it lower than 4 as sometimes theres 3-4 guys living together who all want to play.
Enjoy![]()
i checked out over g_platform and i don't found anything that can make it, you should create a new cpp function, are you using windows or unix?Hey, it works but there is one thing, it shuts down the Client at start (without MC)
I mean the g_platform.isProcessRunning checks if proccess is running while you open the Client, is there any other option?