• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Bounty Hunters System (Player Hunt System)

Woooow, That's is very great, i love all you works (scripts) :), thanks for this realease. I'm using you system on my website, and they is working sucessfull, again thanks. very nice work! :)
 
Talkaction showing hunted players

For those who don't want to use website it may be useful.
add in talkactions.xml:
Code:
<talkaction words="!hunted" script="hunted.lua"/>
create file hunted.lua and paste:
Code:
function onSay(cid, words, param)

	local player = db.getResult("SELECT `sp_id`, `prize` FROM `bounty_hunters` WHERE `killed` = '0' ORDER BY `prize` DESC LIMIT 50;")
	local output = "MOST WANTED:\n"
	if(player:getID() ~= -1) then
		local number = 1
                while (true) do
                    local name = player:getDataString("sp_id")
                    local prize = player:getDataInt("prize")

                    output = output.. "\n"..number..". "..getPlayerNameByGUID(name).." - "..prize.."k"
                    number = number + 1
                    if not(player:next()) then
                        break
                    end
                end
                player:free()
	end
	doShowTextDialog(cid, 5958, output)

return TRUE
end

Removing hunt after dead - kill.lua:
Code:
function onKill(cid, target)
if isPlayer(target) == TRUE then
---- BOUNTY HUNTERS START -----
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
print(bid)
print(prize)
if (bid ~= 0 and prize ~= 0 and getTileInfo(getCreaturePosition(cid)).pvp ~= true) then
    db.executeQuery("DELETE FROM `bounty_hunters` WHERE `id`  = "..bid..";")
    doPlayerAddMoney(cid,prize*1000)
    doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'[BOUNTY HUNTERS] You killed hunted player, so you gained the reward!')
end    
---- BOUNTY HUNTERS END -----
end
return TRUE
end

Rep me if it's helpful :)

@topic: Creaturescript doesn't work for me :( Anyone know what's wrong with it ? (TFS 0.3.3)
 
Last edited:
For those who don't want to use website it may be useful.
add in talkactions.xml:
Code:
<talkaction words="!hunted" script="hunted.lua"/>
create file hunted.lua and paste:
Code:
function onSay(cid, words, param)

    local player = db.getResult("SELECT `sp_id`, `prize` FROM `bounty_hunters` WHERE `killed` = '0' ORDER BY `prize` DESC LIMIT 50;")
    local output = "MOST WANTED:\n"
    if(player:getID() ~= -1) then
        local number = 1
                while (true) do
                    local name = player:getDataString("sp_id")
                    local prize = player:getDataInt("prize")

                    output = output.. "\n"..number..". "..getPlayerNameByGUID(name).." - "..prize.."k"
                    number = number + 1
                    if not(player:next()) then
                        break
                    end
                end
                player:free()
    end
    doShowTextDialog(cid, 5958, output)

return TRUE
end
Rep me if it's helpful :)

@topic: Creaturescript doesn't work for me :( ANyone know what's wrong with it ? (TFS 0.3.3)

kwel, and just use my script (posted some posts before this one!)
 
still doesn't work. There's no error, i'm using 0.3.3, and script seems not to be executed...
 
It works for me in game with 0.3b3 but on the page not 100%
Code:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Documents and Settings\Admin\Desktop\OT\xampplite\htdocs\bounty-hunters.php on line 44

They dont show up on the page and at the top there is that error. Any ideas? Kelencia - Bounty Hunters
 
Yes it is...

amm now i dont know what to say... is just that im not ... a sage that can see your source codes srry xD ...

FAQ

What should i do if my script is not working?
A: Post it (with the code?)

What should i do if my script is not working?
A: You must read above...

What should i do if i dont get an answer?
A: Google for: WE DONT CARE or call the 01-800-IDONTCARE

Why should i put my source code here?
A: Because we are not gods and we just see what you put on screen.
 
Anyone knows how to fix this error on the site? Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\~~\bounty-hunters.php on line 44?

it works perfectly in game :D
 
[only TFS 0.3+ versions]
I'll add this feature to my acc. maker or something better (my php/lua scripts - work with sqlite, optimized) :)
 
NO I didn't change anything.I put everything in the right place I think... Any suggestions ?
 
yes you did it! or... are you saying that you confuse numbers? (3!=2)

Any idea? Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\~\bounty-hunters.php on line 44.

Really I did everything right. Using TFS 0.3+ and Gesior's account manager.
 
Any idea? Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\~\bounty-hunters.php on line 44.

Really I did everything right. Using TFS 0.3+ and Gesior's account manager.

line 44:

PHP:
while($tab = mysql_fetch_array($inv)){
PHP:
$inv = mysql_query("SELECT * FROM `bounty_hunters` ORDER BY `added` DESC");
Did you add the sql query?:

Code:
CREATE TABLE IF NOT EXISTS `bounty_hunters` (
  `id` int(11) NOT NULL auto_increment,
  `fp_id` int(11) NOT NULL,
  `sp_id` int(11) NOT NULL,
  `k_id` int(11) NOT NULL,
  `added` int(15) NOT NULL,
  `prize` int(11) NOT NULL,
  `killed` int(11) NOT NULL,
  `kill_time` int(15) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
 
Back
Top