VO

Doplayerremovefrag(Cid, Count)

Por Vodkart, 27 de ago. de 2012 em Mods, funções e outros

script
3
918
VodkartV
27 de agosto de 2012 às 20:31

Sobre: É para remover certa quantidade de frags o jogador, a maioria dos script de clean frag removia todos =/

 

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

 

uma talk de exemplo:

 

 

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

SkyLighS
27 de agosto de 2012 às 20:52

Bem interessante esta function

 

você se importaria se eu criasse um script com ela ?

 

rep + amanha acabei de te da 1

VodkartV
27 de agosto de 2012 às 20:54

Bem interessante esta function

 

você se importaria se eu criasse um script com ela ?

 

rep + amanha acabei de te da 1

 

De modo algum amigo, a função foi compartilhada na comunidade para ser aproveitada!

 

Pode fazer que script você quiser xD