Eu gostaria de fazer uma adição a um script de bounty hunter. Quero que o player marcado para ser caçado, fique com uma Skull Laranja, amarela, ou verde (não sei se a cor da skull modifica alguma coisa no jogo).
O script é o seguinte:
function onSay(cid, words, param)
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] Use: \"!hunt [prize],[nick]\" where prize is for example 1(k).")
return TRUE
end
local t = string.explode(param, ",")
if(not t[2]) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] Use: \"!hunt [prize],[nick]\" where prize is for example 1(k).")
return TRUE
end
local sp_id = getPlayerGUIDByName(t[2])
if sp_id == nil then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] This player doesn't exists.")
return TRUE
end
local result_plr = db.getResult("SELECT * FROM `bounty_hunters` WHERE `sp_id` = "..sp_id.." AND `killed` = 0;")
if(result_plr:getID() ~= -1) then
is = tonumber(result_plr:getDataInt("sp_id"))
result_plr:free()
else
is = 0
end
prize = tonumber(t[1])
if(prize == nil or prize < 1) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] Use: \"!hunt [prize],[nick]\" where prize is for example 1(k).")
return TRUE
end
if(prize >= 100000000000000000000) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] Sorry, you typed too big number!")
return TRUE
end
if is ~= 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] This player has already hunted.")
return TRUE
end
if doPlayerRemoveMoney(cid, prize) == TRUE then
db.executeQuery("INSERT INTO `bounty_hunters` VALUES (NULL,"..getPlayerGUID(cid)..","..sp_id..",0," .. os.time() .. ","..prize..",0,0);")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] Hunt has been added!")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] You haven't got enough money!")
end
return 1
end
Não entendo de scripts, mas pelo que pesquisei eu poderia usar a função doCreatureSetSkullType(cid, SKULL_YELLOW)
Tentei adicionar isso na parte:
if doPlayerRemoveMoney(cid, prize) == TRUE then
db.executeQuery("INSERT INTO `bounty_hunters` VALUES (NULL,"..getPlayerGUID(cid)..","..sp_id..",0," .. os.time() .. ","..prize..",0,0);")
doCreatureSetSkullType(cid, SKULL_RED)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] Hunt has been added!")
else
Mas quem recebe a skull é o player que encomendou a morte. E quando ele dá logout ele perde a skull.
Como deveria ser o parâmetro para que o jogador correto recebesse a skull?
info
Grupo: Campones
Registrado: 17/08/07
Posts: 3
Reputação: 0
Gênero: Masculino
Eu gostaria de fazer uma adição a um script de bounty hunter. Quero que o player marcado para ser caçado, fique com uma Skull Laranja, amarela, ou verde (não sei se a cor da skull modifica alguma coisa no jogo).
O script é o seguinte:
function onSay(cid, words, param) if(param == "") then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] Use: \"!hunt [prize],[nick]\" where prize is for example 1(k).") return TRUE end local t = string.explode(param, ",") if(not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] Use: \"!hunt [prize],[nick]\" where prize is for example 1(k).") return TRUE end local sp_id = getPlayerGUIDByName(t[2]) if sp_id == nil then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] This player doesn't exists.") return TRUE end local result_plr = db.getResult("SELECT * FROM `bounty_hunters` WHERE `sp_id` = "..sp_id.." AND `killed` = 0;") if(result_plr:getID() ~= -1) then is = tonumber(result_plr:getDataInt("sp_id")) result_plr:free() else is = 0 end prize = tonumber(t[1]) if(prize == nil or prize < 1) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] Use: \"!hunt [prize],[nick]\" where prize is for example 1(k).") return TRUE end if(prize >= 100000000000000000000) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] Sorry, you typed too big number!") return TRUE end if is ~= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] This player has already hunted.") return TRUE end if doPlayerRemoveMoney(cid, prize) == TRUE then db.executeQuery("INSERT INTO `bounty_hunters` VALUES (NULL,"..getPlayerGUID(cid)..","..sp_id..",0," .. os.time() .. ","..prize..",0,0);") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] Hunt has been added!") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bOUNTY HUNTERS] You haven't got enough money!") end return 1 endNão entendo de scripts, mas pelo que pesquisei eu poderia usar a função doCreatureSetSkullType(cid, SKULL_YELLOW)
Tentei adicionar isso na parte:
Mas quem recebe a skull é o player que encomendou a morte. E quando ele dá logout ele perde a skull.
Como deveria ser o parâmetro para que o jogador correto recebesse a skull?
Abraços!
Editado Agosto 16 por Socera-boladaum