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

TFS 0.X TFS 0.4 Creaturescript - topfrags

FearWar

Active Member
Joined
Sep 17, 2017
Messages
221
Reaction score
26
Location
Brasil
Hi otlanders,

I am using this script, so when one player kills another, it is to update my database, but it is not working, can anyone help me?

XML:
    <event type="kill" name="topfrags" event="script" value="topfrags.lua"/>
scripts
Lua:
local skulls = {SKULL_WHITE, SKULL_YELLOW, SKULL_RED, SKULL_BLACK}

function addPlayerFrag(cid, value)
    db.executeQuery("UPDATE `players` SET `frags_all` = `frags_all` + " .. value .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";")
    return true
end

function onKill(cid, target)
    if isPlayer(cid) and isPlayer(target) then
        for i= 1, #skulls do
            if getPlayerSkullType(target) == skulls[i]  then
                addPlayerFrag(cid, 1)
                break
            end
        end
    end
    return true
end
login
registerCreatureEvent(cid, "topfrags")
 
Back
Top