• 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'm a noob, and I need help


The Forgotten Server

Open file login.lua in creaturescripts/scripts and after
Code:
	registerCreatureEvent(cid, "PlayerDeath")
paste
Code:
	registerCreatureEvent(cid, "BountyHunter")

There is no
Code:
registerCreatureEvent(cid, "PlayerDeath")
In my login.lua

Bounty Hunters on WWW
It will work on all Account makers

After, open index.php and after:
PHP:
    case "guilds";
        $topic = "Guilds";
        $subtopic = "guilds";
        include("guilds.php");
    break;

Where do I find this index.php?
 
I need some help modifying this script, I want it so if theres an higher bid and the player hasn't been killed , to update the prize.

This is my attempt failed tho :p
edit-- made it work here it is
Code:
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 function getPrize(cid)
	local Info = db.getResult("SELECT `prize` FROM `bounty_hunters` WHERE `sp_id` = " .. sp_id .. ";")
    local p = Info:getDataInt("prize")
    Info:free()
    return p
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 >= 10000) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] Sorry, you typed too big number!")
		return TRUE
	end

	if is ~= 0 then
		--if prize < getPrize(sp_id) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] This player has already hunted.")	
		if prize > getPrize(sp_id) then
			if doPlayerRemoveMoney(cid, prize*1000) == TRUE then
				db.executeQuery("UPDATE `bounty_hunters` SET `prize`=" ..prize.. " WHERE `sp_id` = ".. sp_id .." ;")
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] The bounty has been modified.")	
			else
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] You haven't got enough money!")			
			end
		end
		return TRUE
		--elseif is == 0 then
		--db.executeQuery("UPDATE `bounty_hunters` SET `prize`=" ..prize.. "WHERE `sp_id` = ".. sp_id .." ;")
		--doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] The bounty has been modified.")	
		--end
	end
	
		if doPlayerRemoveMoney(cid, prize*1000) == TRUE then
			--if is ~= 0 then
			--	db.executeQuery("UPDATE `bounty_hunters` SET `prize`='prize' WHERE `sp_id`= ".. sp_id .." ;")
			--else
				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!")	
			--end
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] You haven't got enough money!")			
		end
	
	
	return 1
end
 
Last edited:
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` bigint(20) 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;

i have to copy this code in any place or i have to create the table manually?
please help me, i im searching for the answer for very much time!!!
sorry for my english
 
Can someone show me a way to just get the hunted player and prize to show up in Nicaw? I've been searching everywhere. it seems like it'd be easy to just look up a couple of things.

inb4 "don't use nicaw" : I like Nicaw :p
 
Zamiast:
prize = tonumber(t[1])
powinno być tak:
prize = tonumber(t[1])
if math.mod(prize , 1) ~= 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wpisales liczbe zmienno przecinkowa! nie uda Ci sie!")
return true
end


/\ plz translate
 
Back
Top