Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Segue a creaturescript do auto hunted, alguem me fala como se configura?

 

scripts do system

 

talkactions

function onSay(cid, words, param)

if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bounty System]: Usage: \"!bounty [gold],[nick]\" where gold is at least 10000.")
return TRUE
end
local t = string.explode(param, ",")
if(not t[2]) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bounty System]: Usage: \"!bounty [gold],[nick]\" where gold is at least 10000.")
return TRUE
end

local sp_id = getPlayerGUIDByName(t[2])
if sp_id == nil then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bounty System]: You cant put a bounty on imaginary people, your target doesn't exist.")
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 < 10000) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[bounty System]: Usage: \"!bounty [gold],[nick]\" where gold is at least 10000.")
return TRUE
end

if(prize >= 999999999) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[bounty System]: Sorry, bounty limit is at 999.9 million gold!")
return TRUE
end if is ~= 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "[bounty System]: "..t[2].." has already got a bounty on his/her head.")
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_RED, "[bounty System]: Bounty on "..t[2].."s head has been added successfully!")
doBroadcastMessage("[bounty System]: A bounty of "..prize.." gold for "..t[2].."s head has been submitted by "..getPlayerName(cid)..". The first one to kill "..t[2].." will get the gold!", MESSAGE_EVENT_ADVANCE)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[bounty System]: You dont have enough gold!")
end


return 1
end

 

creaturescript do system

 

function onKill(cid, target)


if isPlayer(target) == TRUE then
pid = cid
pid2 = getPlayerGUID(target)
local result_plr = db.getResult("SELECT * FROM `bounty_hunters` WHERE `sp_id` = "..pid2.." AND `killed` = 0;")
if(result_plr:getID() ~= -1) then
prize = tonumber(result_plr:getDataInt("prize"))
bid = tonumber(result_plr:getDataInt("id"))
result_plr:free()
else
prize = 0
bid = 0
end
if (bid ~= 0 and prize ~= 0 and not(getTileInfo(getCreaturePosition(cid)).pvp)) then
db.executeQuery("UPDATE `bounty_hunters` SET `killed` = 1, `k_id`="..getPlayerGUID(cid)..", `kill_time` = " .. os.time() .. " WHERE `id` = "..bid..";")
doPlayerAddMoney(cid,prize)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,"[bounty System]: You killed "..getPlayerName(target).."! You gained the bounty that was put on his/her head!")
doSendMagicEffect(getCreaturePosition(cid), 27)
doBroadcastMessage("[bounty System]: "..getPlayerName(cid).." killed "..getPlayerName(target).." and gained the bounty! ("..prize.." gold)", MESSAGE_EVENT_ADVANCE)
end
end
return TRUE
end

Scripter: |||||||||| 10%

 

 

Te ajudei?? REP + e ficamos quites...  ;D

 

Atenciosamente,

                   Lucas.

Abraços!

Postado
  • Autor

@UP

Scripter: |||||||||| 10%

 

 

Te ajudei?? REP + e ficamos quites...  ;D

 

Atenciosamente,

                   Lucas.

Abraços!

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo