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

[Help Request] Dying/Logging out

beepperson

New Member
Joined
Dec 5, 2012
Messages
6
Reaction score
0
Hello people!

I have a error when loggin in.. i died and now everytime i logg in i Die and loggout "brave adventure thing hit ok" Loggs back in and dies and repeats..

I'm using TFS for 9.6
Used RME 2.2 for making the map
 
XML:
[<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
    <event type="login" name="PlayerLogin" script="login.lua"/>
    <event type="login" name="FirstItems" script="firstitems.lua"/>
    <event type="death" name="PlayerDeath" script="playerdeath.lua"/>
</creaturescripts>]

and my playerdeath is

Lua:
dofile("./config.lua")

function onDeath(cid, corpse, killer)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You are dead.")
    if deathListEnabled == "yes" then
        local byPlayer = 0
        if killer == 0 then
            killerName = "field item"
        else
            if isPlayer(killer) == TRUE then
                byPlayer = 1
            end
            killerName = getCreatureName(killer)
        end

        db.query("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", '" .. escapeString(killerName) .. "', " .. byPlayer .. ");")
        local resultId = db.storeQuery("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")

        local deathRecords = 0
        while tmpResultId ~= false do
            tmpResultId = result.next(resultId)
            deathRecords = deathRecords + 1
        end

        if resultId ~= false then
            if sqlType == "mysql" then
                while deathRecords > maxDeathRecords do
                    db.query("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1;")
                    deathRecords = deathRecords - 1
                end
            else
                while deathRecords > maxDeathRecords do
                    db.query("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);")
                    deathRecords = deathRecords - 1
                end
            end
        end

        if byPlayer == 1 then
            local targetGuild = getPlayerGuildId(cid)
            if targetGuild ~= 0 then
                local killerGuild = getPlayerGuildId(killer)
                if killerGuild ~= 0 and targetGuild ~= killerGuild and isInWar(cid, killer) == TRUE then
                    local warId = false
                    resultId = db.storeQuery("SELECT `id` FROM `guild_wars` WHERE `status` = 1 AND ((`guild1` = " .. killerGuild .. " AND `guild2` = " .. targetGuild .. ") OR (`guild1` = " .. targetGuild .. " AND `guild2` = " .. killerGuild .. "));")
                    if resultId ~= false then
                        warId = result.getDataInt(resultId, "id")
                        result.free(resultId)
                    end

                    if warId ~= false then
                        db.query("INSERT INTO `guildwar_kills` (`killer`, `target`, `killerguild`, `targetguild`, `time`, `warid`) VALUES (" .. db.escapeString(getCreatureName(killer)) .. ", " .. db.escapeString(getCreatureName(cid)) .. ", " .. killerGuild .. ", " .. targetGuild .. ", " .. os.time() .. ", " .. warId .. ");")
                    end
                end
            end
        end
    end
end


also let me state that i added "may contest" map Where i went up a flight of stairs and died from an unknown reason (was taking damage but no "creature" anywhere)
just a bit of info if that will help out


also ninja Ty for the tag edit

- - - Updated - - -

Moved On to Datapack [Close]
 
Last edited:
Bump! i have the same problem :(

Code:
http://otland.net/threads/after-player-die-log-in-back-and-die-inmediately.202747/
 
Back
Top