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
on creaturescripts.xml :
On lib/functions
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