Hello guys, im adding a top fraggers system in my gesior, bu tiv some prob with a creaturescript that i made, the script hv to add +1 in table frags_all.... The way is players > frags_all
i Made all correct but when a player kill the number of the table do not change!!!
The scripts are above and my server is TFS 1.3
creaturescripts/scripts/topfrags.lua
And
creaturescripts/creaturescripts.xml
THANKSSS
i Made all correct but when a player kill the number of the table do not change!!!
The scripts are above and my server is TFS 1.3
creaturescripts/scripts/topfrags.lua
Code:
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
And
creaturescripts/creaturescripts.xml
Code:
<event type="kill" name="TopFrags" event="script" value="topfrags.lua" />
<event type="login" name="RTopFrags" event="script" value="topfrags.lua" />
THANKSSS