Ir para conteúdo

!bless E !deathlist


GuiZindoidao

Posts Recomendados

meu ot é o crystal server 8.7, queria q voces me ajudassem pq quando eu uso !bless sempre da debug e o deathlist nao está funfando....

 

deathlist.lua:

 

function onSay(cid, words, param, channel)

local config = {displayLimit = 10}

local target = db.getResult("SELECT `name`, `id` FROM `players` WHERE `name` = " .. db.escapeString(param) .. ";")

if(target:getID() == -1) then

doPlayerSendCancel(cid, "Esse Player nao Existe.")

return TRUE

end

local targetName = target:getDataString("name")

local targetGUID = target:getDataInt("id")

target:free()

local str = ""

local deaths = db.getResult("SELECT `time`, `level`, `killed_by`, `altkilled_by` FROM `player_deaths` WHERE `player_id` = " .. targetGUID .. " ORDER BY `time` DESC;")

if(deaths:getID() ~= -1) then

local n = 0

local breakline = ""

repeat

n = n + 1

if(str ~= "") then

breakline = "\n"

end

local time = os.date("%d %B %Y %X ", deaths:getDataInt("time"))

local level = deaths:getDataInt("level")

local lastHitKiller = deaths:getDataString("killed_by")

local mostDamageKiller = deaths:getDataString("altkilled_by")

local killed = ""

if(tonumber(lastHitKiller)) then

killed = getPlayerNameByGUID(tonumber(lastHitKiller))

else

killed = getArticle(lastHitKiller) .. " " .. string.lower(lastHitKiller)

end

if(mostDamageKiller ~= "") then

if(tonumber(mostDamageKiller)) then

killed = killed .. " and by " .. getPlayerNameByGUID(tonumber(mostDamageKiller))

else

killed = killed .. " and by " .. getArticle(mostDamageKiller) .. " " .. string.lower(mostDamageKiller)

end

end

str = str .. breakline .. " " .. time .. " Died at Level " .. level .. " by " .. killed .. "."

until not(deaths:next()) or n > config.displayLimit

deaths:free()

else

str = "No deaths recorded."

end

doPlayerPopupFYI(cid, "Deathlist for player: " .. targetName .. ".\n\n" .. str)

return TRUE

end

 

_____________________

 

bless.lua

 

local bless = {1, 2, 3, 4, 5}

local cost = 50000

function onSay(cid, words, param)

for i = 1, table.maxn(bless) do

if(getPlayerBlessing(cid, bless)) then

doPlayerSendCancel(cid, "You have already all blessings.")

return TRUE

end

end

 

if(doPlayerRemoveMoney(cid, cost) == TRUE) then

for i = 1, table.maxn(bless) do

doPlayerAddBlessing(cid, bless)

end

doCreatureSay(cid, "You are now blessed by the GOD Apsivaflines!" ,19)

doSendMagicEffect(getPlayerPosition(cid), 49)

else

doPlayerSendCancel(cid, "You don\'t have enough money.")

end

return TRUE

end

 

_____________

 

Vlw

Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...