Antes do
if not target:isPlayer() then
return true
end
coloque isso:
local creature, target = Creature(creature), Creature(target)
Por surfnament, 29 de fev. de 2016 em Scripts
Antes do
if not target:isPlayer() then
return true
end
coloque isso:
local creature, target = Creature(creature), Creature(target)
info
Grupo: Artesão
Registrado: 16/09/11
Posts: 100
Reputação: +1

Funcionou! Muuuuito obrigado cara! REP+
Pra quem tiver problema em nao remover gold e nem dar o premio , fique atento que nao pode haver espaço nas virgulas entre [prize] e nick.
Ex correto: !hunt 1,noob
Ex: errado: !hunt 1 , noob
info
Grupo: Conde
Registrado: 07/04/15
Posts: 926
Reputação: +335
Gênero: Masculino

Tópico movido para dúvidas / pedidos resolvidos.
info
Grupo: Artesão
Registrado: 16/09/11
Posts: 100
Reputação: +1

Poderia me ajudar a por o broadcastMenssage no talkaction também? Para na hora que der o hunted ele mande a msg pro server todo?
function onSay(cid, words, param)
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [bOUNTY HUNTERS] Use: \"!hunted kks,nick\".")
return TRUE
end
local t = string.split(param, ",")
if(not t[2]) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [bOUNTY HUNTERS] Use: \"!hunted kks,nick\".")
return TRUE
end
local sp_id = getPlayerGUIDByName(t[2])
if sp_id == nil then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [bOUNTY HUNTERS] Esse player nao existe.")
return TRUE
end
local result_plr = db.storeQuery("SELECT * FROM `bounty_hunters` WHERE `sp_id` = "..sp_id.." AND `killed` = 0;")
if(result_plr ~= false) then
is = tonumber(result.getDataInt(result_plr, "sp_id"))
result.free(result_plr)
else
is = 0
end
prize = tonumber(t[1])
if(prize == nil or prize < 1) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [bOUNTY HUNTERS] Use: \"!hunted kks,nick\".")
return TRUE
end
if(prize >= 100000000000000000000) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [bOUNTY HUNTERS] Desculpe,numero muito grande!")
return TRUE
end
if is ~= 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [bOUNTY HUNTERS] Este player ja esta hunted, confira em nosso site a lista.")
return TRUE
end
if doPlayerRemoveMoney(cid, prize*1000000) == TRUE then
db.query("INSERT INTO `bounty_hunters` VALUES (NULL,"..getPlayerGUID(cid)..","..sp_id..",0," .. os.time() .. ","..prize..",0,0);")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [bOUNTY HUNTERS] Hunted adicionado com sucesso!")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [bOUNTY HUNTERS] Você não tem dinheiro!")
end
return 1
end
Eu tentei usar:
broadcastMessage("Hunted Update:\n " .. creature:getName() .. " deu hunted em " .. target:getName() .. " e esta pagando por sua cabeça: " .. prize .. " kks!", MESSAGE_EVENT_ADVANCE)
porem nao tive sucesso
info
Grupo: Diretor
Registrado: 12/05/12
Posts: 818
Reputação: +578
Gênero: Masculino
Char no Tibia: [ADM] Night

Poderia me ajudar a por o broadcastMenssage no talkaction também? Para na hora que der o hunted ele mande a msg pro server todo?
Eu tentei usar:
broadcastMessage("Hunted Update:\n " .. creature:getName() .. " deu hunted em " .. target:getName() .. " e esta pagando por sua cabeça: " .. prize .. " kks!", MESSAGE_EVENT_ADVANCE)
porem nao tive sucesso
Tente assim:
function onSay(cid, words, param)
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [BOUNTY HUNTERS] Use: \"!hunted kks,nick\".")
return TRUE
end
local t = string.split(param, ",")
if(not t[2]) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [BOUNTY HUNTERS] Use: \"!hunted kks,nick\".")
return TRUE
end
local sp_id = getPlayerGUIDByName(t[2])
if sp_id == nil then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [BOUNTY HUNTERS] Esse player nao existe.")
return TRUE
end
local result_plr = db.storeQuery("SELECT * FROM `bounty_hunters` WHERE `sp_id` = "..sp_id.." AND `killed` = 0;")
if(result_plr ~= false) then
is = tonumber(result.getDataInt(result_plr, "sp_id"))
result.free(result_plr)
else
is = 0
end
prize = tonumber(t[1])
if(prize == nil or prize < 1) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [BOUNTY HUNTERS] Use: \"!hunted kks,nick\".")
return TRUE
end
if(prize >= 100000000000000000000) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [BOUNTY HUNTERS] Desculpe,numero muito grande!")
return TRUE
end
if is ~= 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [BOUNTY HUNTERS] Este player ja esta hunted, confira em nosso site a lista.")
return TRUE
end
if doPlayerRemoveMoney(cid, prize*1000000) == TRUE then
db.query("INSERT INTO `bounty_hunters` VALUES (NULL,"..getPlayerGUID(cid)..","..sp_id..",0," .. os.time() .. ","..prize..",0,0);")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [BOUNTY HUNTERS] Hunted adicionado com sucesso!")
doBroadcastMessage("Hunted Update:\n " .. creature:getName() .. " deu hunted em " .. target:getName() .. " e esta pagando por sua cabeça: " .. prize .. ".")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [BOUNTY HUNTERS] Você não tem dinheiro!")
end
return 1
end
info
Grupo: Artesão
Registrado: 16/09/11
Posts: 100
Reputação: +1

tente assim:
function onSay(cid, words, param)
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [BOUNTY HUNTERS] Use: \"!hunted kks,nick\".")
return TRUE
end
local t = string.split(param, ",")
if(not t[2]) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [BOUNTY HUNTERS] Use: \"!hunted kks,nick\".")
return TRUE
end
local sp_id = getPlayerGUIDByName(t[2])
if sp_id == nil then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [BOUNTY HUNTERS] Esse player nao existe.")
return TRUE
end
local result_plr = db.storeQuery("SELECT * FROM `bounty_hunters` WHERE `sp_id` = "..sp_id.." AND `killed` = 0;")
if(result_plr ~= false) then
is = tonumber(result.getDataInt(result_plr, "sp_id"))
result.free(result_plr)
else
is = 0
end
prize = tonumber(t[1])
if(prize == nil or prize < 1) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [BOUNTY HUNTERS] Use: \"!hunted kks,nick\".")
return TRUE
end
if(prize >= 100000000000000000000) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [BOUNTY HUNTERS] Desculpe,numero muito grande!")
return TRUE
end
if is ~= 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [BOUNTY HUNTERS] Este player ja esta hunted, confira em nosso site a lista.")
return TRUE
end
if doPlayerRemoveMoney(cid, prize*1000000) == TRUE then
db.query("INSERT INTO `bounty_hunters` VALUES (NULL,"..getPlayerGUID(cid)..","..sp_id..",0," .. os.time() .. ","..prize..",0,0);")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [BOUNTY HUNTERS] Hunted adicionado com sucesso!")
for _, pid in pairs(Game.getPlayers()) do
local player = Player(pid)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Hunted Update:\n %s deu hunted em %s e esta pagando por sua cabeça: %d kks!", Player(cid):getName(), t[2], prize))
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hunted [BOUNTY HUNTERS] Você não tem dinheiro!")
end
return 1
end
info
Grupo: Artesão
Registrado: 16/09/11
Posts: 100
Reputação: +1

Sucesso! Reputado denovo muito obrigado , me ajudo de montaaao!
Alguem poderia aproveitar e me ajudar nesse topico?
http://www.xtibia.com/forum/topic/239679-mudar-de-uid-para-item-id/
info
Grupo: Artesão
Registrado: 16/09/11
Posts: 100
Reputação: +1
Galera
Alguem poderia me ajudar com esse script? Este é o Bounty Hunter... Ele esta dando um erro aqui no console e acredito que seja a função target: ....
Alguem me ajuda?
Uso TFS 1.0
Print do erro
https://uploaddeimagens.com.br/images/000/576/705/full/errobounty.png?1456784671
bh-kill.lua
Editado Fevereiro 29 por Prototype