These simple Scripts store Total Deaths, Can be used to modify onLook to show how many deaths a player has, on website, Etc.
050-function.lua
addDeath.lua
Heres a base script to show total Deaths of cid.
Code:
ALTER TABLE players ADD deaths bigint(11) NOT NULL
050-function.lua
LUA:
function doPlayerAddDeaths(cid, add)
return db.executeQuery("UPDATE `players` SET `deaths` = `deaths` + "..add.." WHERE `name` = '"..getCreatureName(cid).."';")
end
function getPlayerDeaths(cid)
local DB_points = db.getResult("SELECT `deaths` FROM `players` WHERE `name` = '"..getCreatureName(cid).."';")
points = DB_points:getDataInt("deaths")
DB_points:free()
return points
end
addDeath.lua
LUA:
function onPrepareDeath(cid, deathList)
doPlayerAddDeaths(cid, 1)
return true
end
Heres a base script to show total Deaths of cid.
LUA:
function onSay(cid, words, param, channel)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have a total of " .. getPlayerDeaths(cid) .. " deaths.")
return true
end