Ir para conteúdo
  • Cadastre-se

Programação Ao logar no servidor dropa todos os itens


Posts Recomendados

Bom dia, boa tarde ou boa noite pessoal do tibiaking, Bom eu estou a procura da ajuda de vocês!

O erro ocorrido é simples porém nâo consigo soluciona-lo de forma alguma e preciso muito da ajuda de vocês. O erro acontece simplesmente quando você é novo no servidor, entra no account manager, e os itens já dropam todos no mesmo sqm que você, logo em seguida vc cria o personagem e os itens caem da mesma forma. E NÃO o problema não é a capacidade do jogador porque logo após q o jogador entra no servidor e os itens caem no chão da para colocar eles ( itens ) em seus devidos lugar.

 

Link para o post
Compartilhar em outros sites

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) .. "."
        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, "ResetDoors")

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

    registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "AdvanceSave")

registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "SkullCheck")
    registerCreatureEvent(cid, "ReportBug")

registerCreatureEvent(cid, "lookreset")
registerCreatureEvent(cid, "DeathC")
registerCreatureEvent(cid, "FimVip")
registerCreatureEvent(cid, "VipReceive")
registerCreatureEvent(cid, "PlayerKill")
    if (InitArenaScript ~= 0) then
    InitArenaScript = 1
    -- make arena rooms free
        for i = 42300, 42309 do
            setGlobalStorageValue(i, 0)
            setGlobalStorageValue(i+100, 0)
        end
    end
    -- if he did not make full arena 1 he must start from zero
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 2 he must start from zero
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 3 he must start from zero
    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0) -- did not arena level
    end
    setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
    setPlayerStorageValue(cid, 42352, 0) -- is not in arena  
return true
end

Link para o post
Compartilhar em outros sites
2 minutos atrás, Strikerzerh disse:

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) .. "."
        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, "ResetDoors")

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

    registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "AdvanceSave")

registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "SkullCheck")
    registerCreatureEvent(cid, "ReportBug")

registerCreatureEvent(cid, "lookreset")
registerCreatureEvent(cid, "DeathC")
registerCreatureEvent(cid, "FimVip")
registerCreatureEvent(cid, "VipReceive")
registerCreatureEvent(cid, "PlayerKill")
    if (InitArenaScript ~= 0) then
    InitArenaScript = 1
    -- make arena rooms free
        for i = 42300, 42309 do
            setGlobalStorageValue(i, 0)
            setGlobalStorageValue(i+100, 0)
        end
    end
    -- if he did not make full arena 1 he must start from zero
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 2 he must start from zero
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 3 he must start from zero
    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0) -- did not arena level
    end
    setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
    setPlayerStorageValue(cid, 42352, 0) -- is not in arena  
return true
end

da proxima vez usa 

Spoiler

Spoiler.

 

Essa arena level, vc usa?

1 minuto atrás, isac001 disse:

da proxima vez usa 

  Mostrar conteúdo oculto

Spoiler.

 

Essa arena level, vc usa?

 

4 minutos atrás, Strikerzerh disse:

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) .. "."
        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, "ResetDoors")

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

    registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "AdvanceSave")

registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "SkullCheck")
    registerCreatureEvent(cid, "ReportBug")

registerCreatureEvent(cid, "lookreset")
registerCreatureEvent(cid, "DeathC")
registerCreatureEvent(cid, "FimVip")
registerCreatureEvent(cid, "VipReceive")
registerCreatureEvent(cid, "PlayerKill")
    if (InitArenaScript ~= 0) then
    InitArenaScript = 1
    -- make arena rooms free
        for i = 42300, 42309 do
            setGlobalStorageValue(i, 0)
            setGlobalStorageValue(i+100, 0)
        end
    end
    -- if he did not make full arena 1 he must start from zero
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 2 he must start from zero
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 3 he must start from zero
    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0) -- did not arena level
    end
    setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
    setPlayerStorageValue(cid, 42352, 0) -- is not in arena  
return true
end

Essa arena level vc usa?

Link para o post
Compartilhar em outros sites

arena padrao, creio que não pois a arena padrao é feita via REMERES, com tile pvp.

Mais tenta usar assim, e testa:
 

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) .. "."
        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, "ResetDoors")

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

    registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "AdvanceSave")

registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "SkullCheck")
    registerCreatureEvent(cid, "ReportBug")

registerCreatureEvent(cid, "lookreset")
registerCreatureEvent(cid, "DeathC")
registerCreatureEvent(cid, "FimVip")
registerCreatureEvent(cid, "VipReceive")
registerCreatureEvent(cid, "PlayerKill")
return true
end

 

Link para o post
Compartilhar em outros sites
2 minutos atrás, isac001 disse:

arena padrao, creio que não pois a arena padrao é feita via REMERES, com tile pvp.

Mais tenta usar assim, e testa:
 


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) .. "."
        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, "ResetDoors")

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

    registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "AdvanceSave")

registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "SkullCheck")
    registerCreatureEvent(cid, "ReportBug")

registerCreatureEvent(cid, "lookreset")
registerCreatureEvent(cid, "DeathC")
registerCreatureEvent(cid, "FimVip")
registerCreatureEvent(cid, "VipReceive")
registerCreatureEvent(cid, "PlayerKill")
return true
end

 

Nao deu certo

Link para o post
Compartilhar em outros sites

Sera q o erro nao pode estar nos first itens?

Minha firstitens:

 

 

local firstItems = {}
firstItems[0] =
{
2173,
2512,
3965,
2124,
2461,
2649,
2643
}
firstItems[1] =
{
2512,
6534,
2124,
2461,
2649,
2643
}
firstItems[2] =
{
2512,
6534,
2124,
2461,
2649,
2643
}
firstItems[3] =
{
2512,
8853,
2543,
2124,
2461,
2649,
2643
}
firstItems[4] =
{
2512,
7453,
7418,
2124,
2461,
2649,
2643
}
firstItems[9] =
{
2512,
7392,
2124,
2461,
2649,
2643
}
firstItems[11] =
{
2512,
8904,
2124,
2461,
2649,
2643
}
firstItems[13] =
{
10310,
2124,
2461,
2649,
2643
}
firstItems[15] =
{
10310,
2124,
2461,
2649,
2643
}


function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 then
for i = 1, table.maxn(firstItems[getPlayerVocation(cid)]) do
doPlayerAddItem(cid, firstItems[getPlayerVocation(cid)][i], 1)
end
if getPlayerSex(cid) == 0 then
doPlayerAddItem(cid, 2467, 1)
else
doPlayerAddItem(cid, 2467, 1)
end
local bag = doPlayerAddItem(cid, 1988, 1)
doAddContainerItem(bag, 2152, 15)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2173, 1)
doAddContainerItem(bag, 2674, 10)
doAddContainerItem(bag, 2175, 1)
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end

Agora, isac001 disse:

Explica como realmente acontece o bug, mostra algo na distro?

Não nao mostra nada na distro, você tem discord?

Link para o post
Compartilhar em outros sites
21 horas atrás, Strikerzerh disse:

Na verdade não foi resolvido eu só descobri da onde veio o erro... se alguem poder me ajudar o erro está na distro

Mostra erro na distro.

 

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Muvuka
      Alguem tem anti-nuker igual a esse 
       

       
    • Por Muvuka
      [SQLite] -=[TFS]=- 0.4 8.60 Alguem faz apk mobile pra mim ip: dexsoft.ddns.net
       
      pra mim
       
      https://www.mediafire.com/file/5klqnyy6k7jda0u/OTClientV8.rar/file
       
      TA TUDO AI
    • Por yuriowns
      Salve rapazes, estou precisando de um client próprio para o meu servidor 7.4, preciso que algum programador experiente e com referências faça um client do jeito que eu procuro. Responda aqui para fazermos um orçamento, obrigado!

      Não sei se estou no lugar certo, se não me desculpem e peço que movam por gentileza!
    • Por paulo thush
      Pessoal to com um grande problema, estou com um servidor TFS 1.4x 10.98, recentemente começou dar um problema, sempre quando falava "trade" com o npc dava um erros, com qual quer npc, o erro e o seguinte.
       
       
      me falaram que o problema e nas sourcer que precisava mudar umas coisas me passaram um link no github esse aqui 
      https://github.com/otland/forgottenserver/pull/3996/files
       
      porem eu vi vídeos no youtube ensinando a compilar, já vi muitos tópicos como compilar a sourcer, ai quando vou compilar da esse erro
      já tentei instalar, desinstala muitas coisas, alterar também não vai, minha sourcer e essa 
      https://github.com/otland/forgottenserver
       
       
      Alguém poderia me ajuda com esse erro, ou ate compilar 100% as sourcer. os Tópicos que eu tentei para compilar e esse daqui, se não poder o link me desculpe.
      https://forums.otserv.com.br/index.php?/forums/topic/169234-windowsvc2019-compilando-sources-tfs-14-vcpkg/
       
      alguém me da uma luz por favor kkk
    • Por Ryzek
      Uso tfs 0.4 trunk3884 bem simples.
      Queria acrescentar magic effects para 255 pois o meu só vai até 69. Encontrei um tópico que falava sobre porém parece ter sido removido, não consigo acessar!
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo