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

Account ban on death? :P

Read the next thing:

The adrenaline rush.

Nothing says fun like knowing that you will lose everything if you die. Dying in MMO's has become so trivial. It means nothing anymore. These days, you hardly find a game that even gives you so much as a loss of gold or experience. It promotes better, less careless game play from the player. Also it promotes more social interaction which is something today's one player MMOs are lacking.

^ ♥
 
You can use this function in a death script.
Code:
doAddBanishment(accId[, length[, reason[, action[, comment[, admin[, statement]]]]]])

Although it might be confusing for people to get banned after they died, so you can also add a storagevalue based on os.time() and check for this in login.lua, if the time isn't over yet send a message with info for example with doPlayerPopupFYI(cid, message) and use doCreatureSetNoMove(cid, true) so a player can't move.
 
Would be cool to see a server with perma death! :p

You could also implement it into an already popular server, and people could chose if they want permadeath on their chars, and there would be highscores etc only for those chars and maybe you could just make it into a one day event or something, the guy that gets furthest with permadeath char could win real money or points. I think that would be really funny, especially if it's a popular ots with much pvp, people would try to kill the highest level guy with permadeath all the time :D

Just some thoughts and ideas :p
 
Would be cool to see a server with perma death! :p

You could also implement it into an already popular server, and people could chose if they want permadeath on their chars, and there would be highscores etc only for those chars and maybe you could just make it into a one day event or something, the guy that gets furthest with permadeath char could win real money or points. I think that would be really funny, especially if it's a popular ots with much pvp, people would try to kill the highest level guy with permadeath all the time :D

Just some thoughts and ideas :p

Thats exactly what im trying to do, but i have problems with my website; deathlist/highscores.
 
Player is not getting banned, im doing it wrong i guess

Code:
local config = {
    deathListEnabled = getConfigInfo('deathListEnabled'),
    sqlType = getConfigInfo('sqlType'),
    maxDeathRecords = getConfigInfo('maxDeathRecords')
}

function onDeath(cid, corpse, killer)
    doAddBanishment(accId[, PermaDeath[, System[, Has[, Punished[, You]]]]]])
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You are dead.")
    if(config.deathListEnabled == "yes") then
        if(killer ~= FALSE) then
            if(isPlayer(killer) == TRUE) then
                killerName = getPlayerGUID(killer)
            else
                killerName = getCreatureName(killer)
            end
        else
            killerName = "field item"
        end

        db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(killerName) .. ");")
        local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")
        if(rows:getID() ~= -1) then
            local deathRecords = rows:numRows(true)
            if(config.sqlType == "sqlite") then
                while(deathRecords > config.maxDeathRecords) do
                    db.executeQuery("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
            else
                while(deathRecords > config.maxDeathRecords) do
                    db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1;")
                    deathRecords = deathRecords - 1
                end
 
doAddBanishment(getAccountIdByName(getCreatureName(cid)), 30 * 24 * 3600, 23, ACTION_BANISHMENT, "AutoBan", getPlayerGUID(cid), "AutoBan")



Thanks garqet, but player still not getting banned after death

playerdeath.lua tfs 0.3

Code:
local config = {
    deathListEnabled = getConfigInfo('deathListEnabled'),
    sqlType = getConfigInfo('sqlType'),
    maxDeathRecords = getConfigInfo('maxDeathRecords')
}

function onDeath(cid, corpse, killer)
    doAddBanishment(getAccountIdByName(getCreatureName(cid)), 30 * 24 * 3600, 23, ACTION_BANISHMENT, "AutoBan", getPlayerGUID(cid), "AutoBan")
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You are dead.")
    if(config.deathListEnabled == "yes") then
        if(killer ~= FALSE) then
            if(isPlayer(killer) == TRUE) then
                killerName = getPlayerGUID(killer)
            else
                killerName = getCreatureName(killer)
            end
        else
            killerName = "field item"
        end

        db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(killerName) .. ");")
        local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")
        if(rows:getID() ~= -1) then
            local deathRecords = rows:numRows(true)
            if(config.sqlType == "sqlite") then
                while(deathRecords > config.maxDeathRecords) do
                    db.executeQuery("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
            else
                while(deathRecords > config.maxDeathRecords) do
                    db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1;")
                    deathRecords = deathRecords - 1
                end
            end
        end
    end
end
 
Last edited:
Back
Top