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

@UP

maybe it doesnt work on 0.2, maybe changing some functions dont know.... maybe... xD

it didnt work for me (bad ids)

but you need to change this on kill.lua:
Code:
db.executeQuery("UPDATE `bounty_hunters` SET `killed` = 1, `k_id`="..cid..", `kill_time` = " .. os.time() .. " WHERE `id`  = "..bid..";")
for

Code:
db.executeQuery("UPDATE `bounty_hunters` SET `killed` = 1, `k_id`="..getPlayerGUID(cid)..", `kill_time` = " .. os.time() .. " WHERE `id`  = "..bid..";")
on bh-add.lua

Code:
db.executeQuery("INSERT INTO `bounty_hunters` VALUES (NULL,"..cid..","..sp_id..",0," .. os.time() .. ","..prize..",0,0);")
to

Code:
db.executeQuery("INSERT INTO `bounty_hunters` VALUES (NULL,"..getPlayerGUID(cid)..","..sp_id..",0," .. os.time() .. ","..prize..",0,0);")
and it will work on your AAC.
 
Very good idea.
But when some1 wants to give for example 10cc for killing the highest lvl, whole server will hunt him to gain the prize.

Anyway nice job.
 
If i already got this in kill.lua:

Code:
dofile("./arena.lua")
function onKill(cid, target)
	if getPlayerStorageValue(cid, isIN) == 1 then
		local Room = getArenaMonsterIdByName(getCreatureName(target))
		if Room ~= 0 then
			setPlayerStorageValue(cid, Room, 1)
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, Cancel[8])
		end
	end
	return TRUE
end
How should i add the:

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 then
    db.executeQuery("UPDATE `bounty_hunters` SET `killed` = 1, `k_id`="..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

Can't get it to work
 
Well I changed it but I still get nothing why I say !hunt 1000, adam
So I guess it dont work on my tfs
 
If i already got this in kill.lua:

Code:
dofile("./arena.lua")
function onKill(cid, target)
	if getPlayerStorageValue(cid, isIN) == 1 then
		local Room = getArenaMonsterIdByName(getCreatureName(target))
		if Room ~= 0 then
			setPlayerStorageValue(cid, Room, 1)
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, Cancel[8])
		end
	end
	return TRUE
end
How should i add the:

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 then
    db.executeQuery("UPDATE `bounty_hunters` SET `killed` = 1, `k_id`="..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

Can't get it to work

same here i also got some code in kill.lua where should i paste it?

thanks in advance
 
same here i also got some code in kill.lua where should i paste it?

thanks in advance

Like this

Code:
dofile("./arena.lua")
function onKill(cid, target)
	if getPlayerStorageValue(cid, isIN) == 1 then
		local Room = getArenaMonsterIdByName(getCreatureName(target))
		if Room ~= 0 then
			setPlayerStorageValue(cid, Room, 1)
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, Cancel[8])
		end
---- 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 then
    db.executeQuery("UPDATE `bounty_hunters` SET `killed` = 1, `k_id`="..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
??
 
Like this

Code:
dofile("./arena.lua")
function onKill(cid, target)
	if getPlayerStorageValue(cid, isIN) == 1 then
		local Room = getArenaMonsterIdByName(getCreatureName(target))
		if Room ~= 0 then
			setPlayerStorageValue(cid, Room, 1)
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, Cancel[8])
		end
---- 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 then
    db.executeQuery("UPDATE `bounty_hunters` SET `killed` = 1, `k_id`="..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
??

will test it later if it works, then i will reply here.
 
Code:
dofile("./arena.lua")
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 then
    db.executeQuery("UPDATE `bounty_hunters` SET `killed` = 1, `k_id`="..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
	if getPlayerStorageValue(cid, isIN) == 1 then
		local Room = getArenaMonsterIdByName(getCreatureName(target))
		if Room ~= 0 then
			setPlayerStorageValue(cid, Room, 1)
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, Cancel[8])
		end
	end

return TRUE
end

And it, I think, will work.
 
Can you make adding bounty by NPC instead of talkaction, please?
 
people, you should add a checktile because if you kill someone in pvp arena or any pvp zone, it gives the reward anyway... i suggest u all...
 
How would I fix this error on the website?

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