Hey, could anyone convert this to TFS 1.2?
it keeps track of the amount of monsters a player has killed so it can be viewed on the webpage.
Thanks in advance.
Code:
function onKill(cid, target)
if(isMonster(target) == TRUE) then
local name = getCreatureName(target)
local monsterkills = db.query("SELECT mid, kills FROM vorgpl_monsterskills WHERE name = '" .. name .. "' LIMIT 1")
if(monsterkills:getID() ~= -1) then
db.query("UPDATE vorgpl_monsterskills SET kills = " .. (monsterkills:getDataInt("kills") + 1) .. " WHERE mid = " .. monsterkills:getDataInt("mid") .. " LIMIT 1")
else
db.query("INSERT INTO vorgpl_monsterskills (name, kills) VALUES ('" .. name .. "', 1)")
end
end
return TRUE
end
it keeps track of the amount of monsters a player has killed so it can be viewed on the webpage.
Thanks in advance.