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

TalkAction New DeathList!

Critico

Sexy
Joined
Mar 25, 2010
Messages
370
Reaction score
176
!deathlist
Show latest deaths server:
1x19B.png

!deathlist NAME
ar7Kj.png


in your db execute this query:

Code:
CREATE TABLE death_list (
    id          INTEGER NOT NULL,
    player_id   INTEGER NOT NULL,
    date        INTEGER NOT NULL,
    level       INTEGER NOT NULL,
    killer_name INTEGER NOT NULL,
    PRIMARY KEY ( id )
);

creaturescript

death_list.lua
Code:
function onDeath(cid, corpse, deathList)
local str = ""
        for _, pid in ipairs(deathList) do
                if isCreature(pid) == true then
str = str.."".. (str == "" and "" or ",") ..""..getCreatureName(pid)
                else
str = str.."".. (str == "" and "" or ",") .." a field item"
                end
        end
str = str.."."
death = str .. " ".. (getPlayerBlessing(cid, 5) and "[Blessed]" or getPlayerSlotItem(cid, 2).itemid == 2173 and "[AOL]" or "")
db.executeQuery("INSERT INTO `death_list` (`player_id`, `date`, `level`, `killer_name`) VALUES ('".. getPlayerGUID(cid).."', '".. os.time() .."', '".. getPlayerLevel(cid) .."', '".. death .."');")
return true
end

creaturescript.xml
Code:
<event type="death" name="DeathList" event="script" value="death_list.lua"/>

creaturescript/script/login.lua
Code:
registerCreatureEvent(cid, "DeathList")

talkactions

deathlist.lua
Code:
limit = 5
function onSay(cid, words, param, channel)
str = ""
if param == "" then
local qry = db.getResult("SELECT `player_id`, `date`, `level`, `killer_name` FROM `death_list` ORDER BY `date` DESC LIMIT 0, " .. limit)
if(qry:getID() ~= -1) then
repeat
str = str .."\n "..os.date("%d %B %Y %X ", qry:getDataInt("date")).." "..getPlayerNameByGUID(qry:getDataString("player_id")).." died at level "..qry:getDataInt("level").." by:\n"..qry:getDataString("killer_name")
until not(qry:next())
qry:free()
else
str = "Não há mortes no servidor."
end
doPlayerPopupFYI(cid, "Last Deaths:\n\n" .. str)
return true
end
local getGuid = getPlayerGUIDByName(param:lower())
if not getGuid then doPlayerSendCancel(cid, "Este Player não existe.") return true end
local qry = db.getResult("SELECT `id`, `date`, `level`, `killer_name` FROM `death_list` WHERE `player_id` = " .. getGuid .." ORDER BY `date` DESC LIMIT 0, " .. limit)
if(qry:getID() ~= -1) then
repeat
str = str .."\n "..os.date("%d %B %Y %X ", qry:getDataInt("date")).." died at level "..qry:getDataInt("level").." by:\n"..qry:getDataString("killer_name")
until not(qry:next())
qry:free()
else
str = "Não há mortes."
end
doPlayerPopupFYI(cid, "Last Deaths of: " .. param .. ".\n\n" .. str)
return true
end

talkactions.xml
Code:
<talkaction words="!deathlist" script="deathlist.lua"/>
 
Last edited:
i dont see the point where it needs to show if i died with aol or if im vip lol
you must have been really bored....A+ for Effort
and would if you got aol,blessed and ur vip?
[AOL][blessed][VIP]
 
i dont see the point where it needs to show if i died with aol or if im vip lol
you must have been really bored....A+ for Effort
and would if you got aol,blessed and ur vip?
[AOL][blessed][VIP]
what would that be your VIP? explains...
 
10d5zy1.jpg
CREATE TABLE death_list ( id INTEGER NOT NULL, player_id INTEGER NOT NULL, date INTEGER NOT NULL, level INTEGER NOT NULL, killer_name INTEGER NOT NULL, PRIMARY KEY ( id ) );
where can i put this? DB? btw i made everything but i didnt put this on DB cuz i dont know what this

[03/12/2014 15:56:04] OTSYS_SQLITE3_PREPARE(): SQLITE ERROR: no such table: death_list (SELECT "id", "date", "level", "killer_name" FROM "death_list" WHERE "player_id" = 27 ORDER BY "date" DESC LIMIT 0, 5)
 
Last edited:
1° Open Sqlite program
2° Select the database on your server , the file is this ".s3db " , for example "forgottenserver.s3db"
3° the top of the program has the tab "Tools" , click on it and select "Open SQL query editor " or ( ALT + E ) if desired
4° a window will open , You put:

Code:
CREATE TABLE death_list (
    id          INTEGER NOT NULL,
    player_id   INTEGER NOT NULL,
    date        INTEGER NOT NULL,
    level       INTEGER NOT NULL,
    killer_name INTEGER NOT NULL,
    PRIMARY KEY ( id )
);

5 ° Then click the lightning bolt icon there at the top or press the F9 button that will cause the query to run.
 
hmm right...
I will make a globalevent that deletes death after 7 or 15 days on db
 
Lol is it possible to cause debug on server cuz of alot of deaths? I'm using your deathlist
 
Back
Top