• 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!

Windows Cannot logout after death! Please Help Avesta

zufux

Member
Joined
Sep 1, 2008
Messages
221
Reaction score
5
Hello,

I got a serios problem with my distro...


If a character died, the screen is freezing and you can not relog the character!

You need exit the client and relog again in to the game, I really don't know how to fix it.

thats my died.lua
Code:
function onDie(cid, corpse)

-- Bless System
if getPlayerStorageValue(cid, 30006) == 1 then
    setPlayerStorageValue(cid, 30007,1)
end

end

I think it is not the problem with my died.lue I need change it in my distro sources!

In wich sources i can find anythink about the dead? I need to change it, maybe anyone got allrady this problem and know how I can do it!

Thank you
 
it is a OTServ - Avesta mix... I not create it self, a friend shared the sources with me. It is 7.72 protocol
 
Try this @zufux

Code:
function onDie(cid, corpse)
    -- Bless System
    if getPlayerStorageValue(cid, 30006) == 1 then
        setPlayerStorageValue(cid, 30007,1)
    end
    return true
end

--EDIT

If return true doesnt work try return 1
 
Try this @zufux

Code:
function onDie(cid, corpse)
    -- Bless System
    if getPlayerStorageValue(cid, 30006) == 1 then
        setPlayerStorageValue(cid, 30007,1)
    end
    return true
end

--EDIT

If return true doesnt work try return 1


is not working, i think maybe it is a problem in my sources... you know maybe where is it written?
 
creaturescripts.xml:
Code:
<event type="die" name="removeBless" script="die.lua"/>

login.lua: Somewhere under function onLogin(cid)
Code:
registerCreatureEvent(cid, "removeBless")
 
Last edited:
maybe here can find anyone a problem?




Code:
function onLogin(cid)
        checkStages(cid)
        RemoveAllBlessings(cid)
        registerCreatureEvent(cid, "OnKill")
        registerCreatureEvent(cid, "onThink")
        registerCreatureEvent(cid, "StagesAdvance")
        registerCreatureEvent(cid, "removeBless")
        registerCreatureEvent(cid, "onLogout")
        registerCreatureEvent(cid, "MoveItem")

    local str = ""
        db.query('UPDATE `players` SET `status` = 1 WHERE `id` = '..getPlayerGUIDByName(getCreatureName(cid))..'')

        if (getConfigValue("DjinnQuestsAcces") == true) then
          if (getPlayerStorageValue(cid,43678) ~= 1) then
              setPlayerStorageValue(cid,1023,1)
              setPlayerStorageValue(cid,1006,1)
              setPlayerStorageValue(cid,1038,1)
              setPlayerStorageValue(cid,1002,1)
              setPlayerStorageValue(cid,1031,1)
              setPlayerStorageValue(cid,1015,1)
              setPlayerStorageValue(cid,43678,1)
          end
        end

       
       
       
--Bed System--
if getPlayerStorageValue(cid, 1340) >= 1 then
    if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 then --If is Sorcerer or Druid
    hppermin = (0.16)
    manapermin = (1.66)
    elseif getPlayerVocation(cid) == 3 then --If is paladin
    hppermin = (0.33)
    manapermin = (1.0)   
    elseif getPlayerVocation(cid) == 4 then --If is knight
    hppermin = (0.5)
    manapermin = (0.66)
    elseif getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 then --If is promo Sorcerer or promo Druid
    hppermin = (0.16)
    manapermin = (2.5)   
    elseif getPlayerVocation(cid) == 7 then --If is promo paladin
    hppermin = (0.41)
    manapermin = (1.33)   
    elseif getPlayerVocation(cid) == 8 then --If is promo knight
    hppermin = (0.66)
    manapermin = (0.83)
    end   
sleepmintime = ((os.time()-getPlayerStorageValue(cid, 1340))/60)
if sleepmintime <= 5 then
sleepmintime = 0
elseif sleepmintime >= 480 then
sleepmintime = 480
end

sleephpgain = (sleepmintime*hppermin)
sleepmanagain = (sleepmintime*manapermin)

doPlayerAddHealth(cid, sleephpgain)
doPlayerAddMana(cid, sleepmanagain)

setPlayerStorageValue(cid,1340,0)
end
--//Bed System--


if  getPlayerLevel(cid) <= 30 then
  setPlayerStorageValue(cid, 82001, 1) 
    setPlayerStorageValue(cid, 82002, 1)   
      setPlayerStorageValue(cid, 82003, 1)    
        setPlayerStorageValue(cid, 82004, 1)       
          setPlayerStorageValue(cid, 82005, 1)
           doPlayerSetLossPercent(cid, 3, 0)
           doPlayerSendTextMessage(cid,22,"You are protected by all blessings.")
  
                   end   
                 
                   if  getPlayerLevel(cid) >= 31 then
                           doPlayerSetLossPercent(cid, 3, 10)

                          
                           end

            
            
            
            
-- Primeiros Itens
    local firstItems = {2512,2382,2050}
    if getPlayerStorageValue(cid, 30001) == -1 then
        for i = 1, table.maxn(firstItems) do
            doPlayerAddItem(cid, firstItems[i], 1)
        end
    if getPlayerSex(cid) == 0 then
        doPlayerAddItem(cid, 2651, 1)
    else
        doPlayerAddItem(cid, 2650, 1)
    end
    local bag = doPlayerAddItem(cid, 1987, 1)
        doAddContainerItem(bag, 2674, 1)
        setPlayerStorageValue(cid, 30001, 1)
    end


        local Blessings = 1,5
        if (getPlayerBless(cid, Blessings) == 1) then
           if (getPlayerStorageValue(cid,43668) ~= 1) then
               setPlayerStorageValue(cid,43668,1)
           end
        end
        return TRUE
end
 
Back
Top