• 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!

TalkAction Bounty Hunters System (Player Hunt System)

I got an error!

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\bounty-hunter.php on line 52


why?
 
someone has the answer?

ok i got it...

Code:
prize = math.abs(t[1])

so, no more negative numbers!
 
Last edited:
Nice :thumbup:
About time someone released a script like this. Thanks for not being greedy.
 
Can you make a talkaction command like !showtargets.. where we can see all the targets that we can kill to get a bounty?.. please.. I do not have web account maker, i work with account manager and i cant see the targets..
 
Last edited:
Can you explain how to add the system in website for noobaks(likem me :D)? I did all the steps here, it works perfect for me in game, also I did everything that u said with php in my account maker, but I still cant see it on my website. There is no button Bounty-hunters(how to insert it? :( )
 
Open the file layout.php in layouts/tibiacom and then find:
<a href='index.php?subtopic=guilds'>
<div id='submenu_guilds' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
<div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>

<div id='ActiveSubmenuItemIcon_guilds' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div>
<div class='SubmenuitemLabel'>Guilds</div>
<div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>
</div>

and after add:
<a href='index.php?subtopic=bounty-hunters'>
<div id='submenu_bounty' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
<div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>

<div id='ActiveSubmenuItemIcon_biunty' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div>
<div class='SubmenuitemLabel'>Bounty Hunters</div>
<div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>
</div>

And its all.
 
you should change this too:

change:

Code:
prize = math.abs(t[1])

to

Code:
prize = tonumber(t[1])

then add:

Code:
    if(not prize) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] No prize specified.")
    return TRUE
    end

and then add:

Code:
prize = math.abs(prize)

i didnt try
Code:
prize = tonumber(math.abs(t[1]))


REASON:

Code:
prize = math.abs(t[1])
causes a lua error ._.

and you should get a msg when you dont put a prize =D (non numeric value)
 
Last edited:
Hello! I added everything that tutorial says and I got following errors:

1) WHen I kill someone that is hunted he freezes(his death is bugged)



2)Also I get theese errors on web:
Code:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'user'@'localhost' (using password: YES) in C:\xampp\htdocs\bounty-hunters.php on line 2

Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\bounty-hunters.php on line 3

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in C:\xampp\htdocs\bounty-hunters.php on line 3

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\bounty-hunters.php on line 41

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\xampp\htdocs\bounty-hunters.php on line 41

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

Screenshoot(web errors)



I need to find solution for theese problems. If someone knows what to do please pm me here(otland) or post your msn/answer below.

THank you! :*
 
Thank you! But I still need help with first problem!

:s How to fix this?


 
Last edited:
You've done something wrong in your kill.lua :)
Because i have too many things in kill.lua i've done this in another way:
Create new file in creaturescripts and name it bounty.lua and there put this:
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

if bid ~= 0 and prize ~= 0 and getTileInfo(getCreaturePosition(cid).pvp ~= true) then
db.executeQuery("UPDATE `bounty_hunters` SET `killed` = 1, `k_id`="..getPlayerGUID(cid)..", `kill_time` = " .. os.time() .. " 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

Now go to login.lua and there put this:
registerCreatureEvent(cid, "BountyHunter")

And now go to creaturescripts.xml and there put this:
<event type="kill" name="BountyHunter" script="bounty.lua"/>

Ps: You need to have kill function
 
6] [Warning - Event::loadScript] Can not load script (data/creaturescripts/scripts/bounty.lua)
[06/04/2009 22:21:46] data/creaturescripts/scripts/bounty.lua:19: ')' expected near '_BLUE'


:D
 
OMG !
F*ck ! Can't you read this error by yourself and undrestand what is wrong? lol o_O
Clue: Line 19 in bounty.lua you need to delete the space near _blue
from MESSAGE_STATUS_CONSOLE _BLUE to MESSAGE_STATUS_CONSOLE_BLUE
 
bump
helloo.. somebody use this script on tfs 0.2?? :]

thx for your answer.
 
Back
Top