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

Lua Add a frag..

knightxd

Member
Joined
Feb 21, 2009
Messages
211
Reaction score
16
Location
Rio de Janeiro
i'm trying to add a frag to players in a creature event;

the part that add frags is

Lua:
l = db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `date`, `level`) VALUES (" .. getPlayerGUID(pid) .. ", " .. os.time() .. ", " .. getPlayerLevel(pid) .. ");")
j = db.executeQuery("INSERT INTO `killers` ('death_id', 'final_hit', 'unjustified') VALUES (" .. l .. ", 1, 1);")	
db.executeQuery("INSERT INTO `player_killers` (`kill_id`, `player_id`) VALUES (" .. j .. ", " .. getPlayerLevel(cid) .. ");")

ps. the part of add player deaths work just fine...

the other two is not because i don't know what id to use on the first entryes.. :S
 
Code:
function onKill(cid, target, damage, flags)
    if getCreatureName(target):lower() == "princess" then
    l = db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `date`, `level`) VALUES (" .. getPlayerGUID(pid) .. ", " .. os.time() .. ", " .. getPlayerLevel(pid) .. ");")
j = db.executeQuery("INSERT INTO `killers` ('death_id', 'final_hit', 'unjustified') VALUES (" .. l .. ", 1, 1);")
db.executeQuery("INSERT INTO `player_killers` (`kill_id`, `player_id`) VALUES (" .. j .. ", " .. getPlayerLevel(cid) .. ");")
        return true
    end

not tested

posted by mistake! my bad.
 
Back
Top Bottom