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

Help with script !! Fraggers

luhfe

New Member
Joined
Apr 26, 2018
Messages
48
Reaction score
2
I try every script i can found on foruns but any1 work to me ...yea, i have look like 5 foruns.
My site (i'm using ot by malucooo n website) display has work but my sql table has no change.

i think my script has something wrong !! i'm waiting only this to put Ot n Web online !

On creaturescripts\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

function onLogin(cid)
    registerCreatureEvent(cid, "TopFrags")
    return true
end

on creaturescripts.xml :

Code:
    <!-- TopFrags Event -->
<event type="kill" name="TopFrags" event="script" value="topfrags.lua" />
<event type="login" name="RTopFrags" event="script" value="topfrags.lua" />

On lib/functions

Code:
function addPlayerFrag(cid, amount)

db.executeQuery("UPDATE `players` SET `frags_all` = `frags_all` + " .. amount .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";")

end
 
so why do u use addPlayerFrag twice? In lib and creaturescripts? Remove that one from script.

B.t.w Maybe Im wrong but if you wanna save something in database the character must be offline.
 
well, so how i do that !? dont need be a real time but i want create a page with players who have more frags...
 
Yea, can u share this !? ?! its what i`m looking for...
Isso eh o que to procurando mesmo, o site ate ta puxando legal as info mas n edita na sql e eu n sou mt bom nisso =\
 
Amigo além de estar sem mic eu não sou mt familiarizado com o discord... seria muito grato se tentasse me ajudar até mesmo por aqui =\
se não der entendo... como tenho dito meu site ta puxando as informações da tabela, o que não acontece é o registro do Kill de um player pra outro ai quando puxa, puxa o numero 0, null no caso
 
Back
Top