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

Deathlist

amnart

New Member
Joined
Oct 2, 2008
Messages
75
Reaction score
0
Hello, my deathlist stopped working today, anyone know what can be the problem? using gesior aacc and TFS 0.2

-- Deathlist
deathListEnabled = "yes"


I really need help
 
Last edited:
here is my player death.lua


dofile("./config.lua")

function onDeath(cid, corpse, killer)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You are dead.")
if deathListEnabled == "yes" then
if sqlType == "mysql" then
env = assert(luasql.mysql())
con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
else -- sqlite
env = assert(luasql.sqlite3())
con = assert(env:connect(sqliteDatabase))
end
local byPlayer = FALSE
if killer == FALSE then
killerName = "field item"
else
if isPlayer(killer) == TRUE then
byPlayer = TRUE
end
killerName = getCreatureName(killer)
end
assert(con:execute("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", '" .. escapeString(killerName) .. "', " .. byPlayer .. ");"))
local cursor = assert(con:execute("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";"))
local deathRecords = numRows(cursor)
if sqlType == "mysql" then
while deathRecords > maxDeathRecords do
delete = assert(con:execute("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1;"))
deathRecords = deathRecords - 1
end
else
while deathRecords > maxDeathRecords do
delete = assert(con:execute("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
con:close()
env:close()
end
end
 
and I think deathlist stopped worked after I fixed inqusition quest

function onDeath(cid, corpse, killer)

registerCreatureEvent(cid, "inquisitionPortals")

local creaturename = getCreatureName(cid)

--- positions where the teleports will be created:

local ushuriel_in_pos = {x=33592, y=31857, z=11, stackpos=2}
local annihilon_in_pos = {x=33632, y=31897, z=11, stackpos=2}
local hellgorak_in_pos = {x=33539, y=31864, z=11, stackpos=2}
local madareth_in_pos = {x=33632, y=31833, z=11, stackpos=2}
local zugurosh_in_pos = {x=33558, y=31821, z=11, stackpos=2}
local brothers_in_pos = {x=33667, y=31863, z=11, stackpos=1}

--- positions where the teleports will be teleported you:

local ushuriel_to_pos = {x=33598, y=31837, z=14, stackpos=1}
local annihilon_to_pos = {x=33598, y=31837, z=14, stackpos=1}
local hellgorak_to_pos = {x=33598, y=31837, z=14, stackpos=1}
local madareth_to_pos = {x=33598, y=31837, z=14, stackpos=1}
local zugurosh_to_pos = {x=33598, y=31837, z=14, stackpos=1}
local brothers_to_pos = {x=33598, y=31837, z=14, stackpos=1}

local time_to_pass = 180 -- in seconds
local tpID = 1387
local doEffect = CONST_ME_TELEPORT
local message = "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear"

if creaturename == 'Ushuriel' then

teleport = doCreateTeleport(tpID, ushuriel_to_pos, ushuriel_in_pos)

doSendMagicEffect(ushuriel_in_pos, doEffect)

doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

addEvent(removeTeleportInUshurielWard, (1000*time_to_pass))

elseif creaturename == 'Annihilon' then

teleport = doCreateTeleport(tpID, annihilon_to_pos, annihilon_in_pos)

doSendMagicEffect(annihilon_in_pos, doEffect)

doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

addEvent(removeTeleportInAnnihilonWard, (1000*time_to_pass))

elseif creaturename == 'Madareth' then

teleport = doCreateTeleport(tpID, madareth_to_pos, madareth_in_pos)

doSendMagicEffect(madareth_in_pos, doEffect)

doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

addEvent(removeTeleportInMadarethWard, (1000*time_to_pass))

elseif creaturename == 'Hellgorak' then

teleport = doCreateTeleport(tpID, hellgorak_to_pos, hellgorak_in_pos)

doSendMagicEffect(hellgorak_in_pos, doEffect)

doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

addEvent(removeTeleportInHellgorakWard, (1000*time_to_pass))

elseif creaturename == 'Zugurosh' then

teleport = doCreateTeleport(tpID, zugurosh_to_pos, zugurosh_in_pos)

doSendMagicEffect(zugurosh_in_pos, doEffect)

doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

addEvent(removeTeleportInZuguroshWard, (1000*time_to_pass))

elseif creaturename == 'Latrivan' then

teleport = doCreateTeleport(tpID, brothers_to_pos, brothers_in_pos)

doSendMagicEffect(brothers_in_pos, doEffect)

doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

addEvent(removeTeleportInBrothersWard, (1000*time_to_pass))


end
end

function removeTeleportInUshurielWard()
if getThingfromPos({x=33592, y=31857, z=11, stackpos=2}).itemid == 1387 then
doRemoveItem(getThingfromPos({x=33592, y=31857, z=11, stackpos=2}).uid,1)
doSendMagicEffect({x=33592, y=31857, z=11, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end

function removeTeleportInAnnihilonWard()
if getThingfromPos({x=33632, y=31897, z=11, stackpos=2}).itemid == 1387 then
doRemoveItem(getThingfromPos({x=33632, y=31897, z=11, stackpos=2}).uid,1)
doSendMagicEffect({x=33632, y=31897, z=11, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end

function removeTeleportInHellgorakWard()
if getThingfromPos({x=33539, y=31864, z=11, stackpos=2}).itemid == 1387 then
doRemoveItem(getThingfromPos({x=33539, y=31864, z=11, stackpos=2}).uid,1)
doSendMagicEffect({x=33539, y=31864, z=11, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end

function removeTeleportInMadarethWard()
if getThingfromPos({x=33632, y=31833, z=11, stackpos=2}).itemid == 1387 then
doRemoveItem(getThingfromPos({x=33632, y=31833, z=11, stackpos=2}).uid,1)
doSendMagicEffect({x=33632, y=31833, z=11, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end

function removeTeleportInZuguroshWard()
if getThingfromPos({x=33558, y=31821, z=11, stackpos=2}).itemid == 1387 then
doRemoveItem(getThingfromPos({x=33558, y=31821, z=11, stackpos=2}).uid,1)
doSendMagicEffect({x=33558, y=31821, z=11, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end

function removeTeleportInBrothersWard()
if getThingfromPos({x=33667, y=31863, z=11, stackpos=1}).itemid == 1387 then
doRemoveItem(getThingfromPos({x=33667, y=31863, z=11, stackpos=1}).uid,1)
doSendMagicEffect({x=33667, y=31863, z=11, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
 
Back
Top Bottom