Critico
Sexy
- Joined
- Mar 25, 2010
- Messages
- 370
- Reaction score
- 176
About: The function is to remove amount frags(Player)
Talk exemple:
Lua:
function doPlayerRemoveFrag(cid, count) -- by vodka
local query,t,k = db.getResult("SELECT `kill_id` FROM `player_killers` WHERE `player_id` = "..getPlayerGUID(cid)),{},0
if (query:getID() ~= -1) then
repeat
local gs = db.getResult("SELECT `unjustified` FROM `killers` WHERE `id` = "..query:getDataInt("kill_id"))
if (gs:getDataInt("unjustified") ~= 0) then
table.insert(t, query:getDataInt("kill_id"))
k = k +1
end
until not query:next() or k >= count
query:free()
end
for _, frag in pairs(t) do
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` = "..frag)
end
return true
end
Talk exemple:
Lua:
function onSay(cid, words, param, channel)
local amount = 2
if getPlayerFrags(cid) < amount then
doPlayerSendCancel(cid,"You don't remover your frags.") return true
end
doPlayerRemoveFrag(cid, amount)
doCreatureSay(cid, "Your frags and skulls is cleaned!", 19)
doSendMagicEffect(getPlayerPosition(cid), 26)
return true
end