yasminismyworld
Member
it is possible?
doAddBanishment(accId[, length[, reason[, action[, comment[, admin[, statement]]]]]])
Would be cool to see a server with perma death!
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
Just some thoughts and ideas
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")
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