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

Problem With KdR CreatureEvent

cooleo561

New Member
Joined
Nov 4, 2007
Messages
69
Reaction score
2
Hey, Im just messing around with a war server atm and I added a show frags script made by Narko (Official Link: http://otland.net/threads/k-d-ratio-system-by-narko.168501/) and everytime somebody is about to die they just stay alive with no health and I get this error on the server. I am currently running cryingdamson 0.3.6 (8.60) V8.2, and I'm just wondering if anybody knows what the problem is... thanks


upload_2013-9-17_21-13-20.png
 

Attachments

  • upload_2013-9-17_21-12-22.png
    upload_2013-9-17_21-12-22.png
    5.3 KB · Views: 5 · VirusTotal
Yeah I just took it out, I realized what was wrong and fixed that :p

EDIT:

Ok so I changed the script a little bit and didn't receive any errors at all, But I had two test chars and I killed the one with the other, but I still have a problem with the person dying, they just sit at 0 HP but can still move around, they just won't die :p, any suggestions?
 
Last edited:
Why wouldn't you post the script lol

I didnt get any script errors but one second, there are 3 scripts and I'll post them all

onkill.lua
Code:
    function onKill(cid, target, damage, flags)
if isPlayer(target) == true then
db.executeQuery("UPDATE `players` SET `frags` = `frags` + 1 WHERE id = " .. getPlayerGUID(cid) .. ";")
doCreatureSay(cid, '+1 Frag Point!', TALKTYPE_ORANGE_1)
end
end

onlook.lua
Code:
function onLook(cid, thing, position, lookDistance)
function getKillsPlayer(cid)
local Info = db.getResult("SELECT `frags` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1")
local frags= Info:getDataInt("frags")
return frags
end

function getDeathsPlayer(cid)
local Info = db.getResult("SELECT `deaths` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1")
local deaths= Info:getDataInt("deaths")
return deaths
end
if isPlayer(thing.uid) then
local kdr = getKillsPlayer(thing.uid)/getDeathsPlayer(thing.uid)
doPlayerSetSpecialDescription(thing.uid, (getPlayerSex(thing.uid) == 0 and "\nShe" or "\nHe") .. " has Killed: ["..getKillsPlayer(thing.uid).."] Players."..(getPlayerSex(thing.uid) == 0 and "\nShe" or "\nHe") .. " has Died: ["..getDeathsPlayer(thing.uid).."] Times.\nThe Kdr(Kill Death Ratio) is: ["..kdr.."].")
end
if(thing.uid == cid) then
local kdr = getKillsPlayer(thing.uid)/getDeathsPlayer(thing.uid)
doPlayerSetSpecialDescription(thing.uid, "\nYou have Killed: ["..getKillsPlayer(thing.uid).."] Players.\nYou have Died: ["..getDeathsPlayer(thing.uid).."] Times.\nYou Kdr(Kill Death Ratio) is: ["..kdr.."].")
end
return true
end

onpd.lua
Code:
function onPrepareDeath(cid, deathList, lastHitKiller, mostDamageKiller)
if isPlayer(cid) == true then
db.executeQuery("UPDATE `players` SET `deaths` = `deaths` + 1 WHERE id = " .. getPlayerGUID(cid) .. ";")
doCreatureSay(cid, '+1 Death Point!', TALKTYPE_ORANGE_1)
end

return true
end

And here's the SQL script
Code:
ALTER TABLE `players` ADD `frags` INT( 11 ) NOT NULL DEFAULT '0';
ALTER TABLE `players` ADD `deaths` INT( 11 ) NOT NULL DEFAULT '0';
 
Back
Top