local config = {
seconds = 2, -- 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
doAddIpBanishment(playerIP, 2419200)
return FALSE
end
m_lastIP = playerIP
m_lastLogin = timeNow
return TRUE
end
local config = {
seconds = 2, -- 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
doAddIpBanishment(playerIP, 2419200)
return FALSE
end
m_lastIP = playerIP
m_lastLogin = timeNow
return TRUE
end
For 0.2:
Code:local config = { seconds = 2, -- in seconds onlyWithSameIP = TRUE -- will work for all players (FALSE), or only check player with same IP? (TRUE) } local m_lastLogin, m_lastIP = 0, 0 function onLogin(cid) local timeNow, playerIP = os.time(), getIPByPlayerName(getPlayerName(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