• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Login.lua error

homarwh

Just a Milan fan.
Joined
Dec 29, 2012
Messages
93
Reaction score
2
Location
Mexico
[error - creaturescript interface] data/creaturescripts/scripts/login.lua:OnLogin description: <luaregistercreatureevent> creature not found

why is this appearing when a player log-in?

my login.lua

Code:
local config = {
    loginMessage = getConfigValue('loginMessage'),
    useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
    local a = 0
    local limitAM = 5
    if getCreatureName(cid):lower() == "account manager" then
        for _, pid in ipairs(getPlayersOnline()) do
            if getCreatureName(pid):lower() == "account manager" and pid ~= cid then
                a = a + 1
            end
        end

        if a >= limitAM then
            return false
        end

        return true
    end

    local loss = getConfigValue('deathLostPercent')
    if(loss ~= nil) then
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
    end

    local accountManager = getPlayerAccountManager(cid)
    if(accountManager == MANAGER_NONE) then
        local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
        if(lastLogin > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
            str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
        else
            str = str .. " Please choose your outfit."
            doPlayerSendOutfitWindow(cid)
        end

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
    elseif(accountManager == MANAGER_NAMELOCK) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
    elseif(accountManager == MANAGER_ACCOUNT) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
    end

    if(not isPlayerGhost(cid)) then
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
    end

    registerCreatureEvent(cid, "Mail")
    registerCreatureEvent(cid, "ctf_target")
    registerCreatureEvent(cid, "GuildMotd")

registerCreatureEvent(cid, "ZombieAttack")
registerCreatureEvent(cid, "firstmessage")
registerCreatureEvent(cid, "Killer")
registerCreatureEvent(cid, "Assassin")
registerCreatureEvent(cid, "reward")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent("Inquisition")
registerCreatureEvent(cid, "offtrain_PlayerLogin")
registerCreatureEvent(cid, "monsterPortals")

    registerCreatureEvent(cid, "Idle")
    if(config.useFragHandler) then
        registerCreatureEvent(cid, "SkullCheck")
    end

    registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "AdvanceSave")
-- ANTI-TUMB BY LEDTHER0N
local maxaccbyip =1
local accm ={}
local pbi = getPlayersByIp(getPlayerIp(cid))
function antiTumb(cid)
for _,player in ipairs(pbi)do
if getCreatureName(player)=="Account Manager"then
table.insert(accm, player)
end
end
if#accm > maxaccbyip then
print("Has been passed the amount of account manager of the IP "..convertIntToIP(getPlayerIp(cid)).."\nWe don't know if they tried to lag you, or was a error, they were kicked\nSystem By Ledther0n!")
for _,player in ipairs(accm)do
doRemoveCreature(player)
end
end
return true
end
addEvent(antiTumb,10, cid)
-- ANTI-TUMB BY LEDTHER0N
    return true
end
 
Back
Top