Ir para conteúdo
  • 0

Ajuda arruma esse script pfv


maiconloko

Pergunta

Ola adiciona 1 negocio pra min aki no login.lua nao to conseguindo

adicona isto

 

registerCreatureEvent(cid, "maxml")
if getPlayerStorageValue(cid, 20130314) ~= -1 and getPlayerMagLevel(cid, true) >= getPlayerStorageValue(cid, 20130314) then
doPlayerSetMagicRate(cid, 0)
end
return true
end

 

O meu Login.lua é esse

 

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

function onLogin(cid)
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) .. "."
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, "GuildMotd")

registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "ProtDeath")
registerCreatureEvent(cid, "Biohazard")
registerCreatureEvent(cid, "ZombieAttack")
registerCreatureEvent(cid, "WeaponMana")
registerCreatureEvent(cid, "showVoc")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
return true
end

registerCreatureEvent(cid, "maxml")

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

Boa noite.

Faz alguns meses que não mexo com OTServ, mas se não me engano a tag de registro que está tentando adicionar, deve ficar junto com as outras.

 

Ou seja, esta tag:

registerCreatureEvent(cid, "maxml")

Deve estar dentro dessas:

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

    registerCreatureEvent(cid, "Idle")
    if(config.useFragHandler) then
        registerCreatureEvent(cid, "SkullCheck")
    end
           registerCreatureEvent(cid, "ProtDeath")
           registerCreatureEvent(cid, "Biohazard")
           registerCreatureEvent(cid, "ZombieAttack")
           registerCreatureEvent(cid, "WeaponMana")
           registerCreatureEvent(cid, "showVoc")       
           registerCreatureEvent(cid, "ReportBug")
           registerCreatureEvent(cid, "AdvanceSave")
    return true
end

Pois onde finaliza o "return true" e "end" finaliza onde o script estará lendo... Sendo assim, a sua tag não será lida e interpretada pelo Script.

 

O correto seria:

 

 

Seu login.lua assim:

 

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

function onLogin(cid)
    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) .. "."
        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, "GuildMotd")

    registerCreatureEvent(cid, "Idle")
    if(config.useFragHandler) then
        registerCreatureEvent(cid, "SkullCheck")
    end
           registerCreatureEvent(cid, "ProtDeath")
           registerCreatureEvent(cid, "Biohazard")
           registerCreatureEvent(cid, "ZombieAttack")
           registerCreatureEvent(cid, "WeaponMana")
           registerCreatureEvent(cid, "showVoc")       
           registerCreatureEvent(cid, "ReportBug")
           registerCreatureEvent(cid, "AdvanceSave")
          registerCreatureEvent(cid, "maxml")
    return true
end

 

E crie um arquivo com o nome de "maxml.lua" na pasta "creaturescripts / scripts" e cole o conteúdo abaixo dentro:

 

function onLogin(cid)
if getPlayerStorageValue(cid, 20130314) ~= -1 and getPlayerMagLevel(cid, true) >= getPlayerStorageValue(cid, 20130314) then
doPlayerSetMagicRate(cid, 0)
end
return true
end

 

 

 

Espero que dê certo.

 

Boa sorte, pois não testei, apenas coloquei os arquivos em seu devido lugar.

Editado por Adriano Swatt
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...