• 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 Improved Bounty-Hunter System by Tufte

For what u need the "string.lower(hunt) ~= string.lower(getCreatureName(cid))"??
 
[14/08/2009 04:50:44] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/bounty.lua)
[14/08/2009 04:50:44] data/talkactions/scripts/bounty.lua:1: unexpected symbol near '{'

help? jaja
 
edited my first post, so if you get the result not set error, check the buttom of my first post please.

all you have to do, is to replace your lib/database.lua with mine, which is improved by Colandus.

PHP:
if(result == nil) then
	print("> WARNING: Couldn't load database lib.")
	return
end

Result = createClass(nil)
Result:setAttributes({
	id = -1
})

function Result:getID()
	return self.id
end

function Result:setID(_id)
	self.id = _id
end

function Result:getQuery()
	return self.query
end

function Result:setQuery(_query)
	self.query = _query
end

function Result:create(_query)
	self:setQuery(_query)
	local _id = db.storeQuery(self:getQuery())
	if(_id) then
		self:setID(_id)
	end

	return self:getID()
end

function Result:getRows(free)
	if(self:getID() == -1) then
		error("[Result:getRows]: Result not set!")
	end

	local c = 0
	while true do
		if not self:next() then
			break
		end
		
		c = c + 1
	end

	if(free) then
		self:free()
	end

	return c
end

function Result:getDataInt(s)
	if(self:getID() == -1) then
		error("[Result:getDataInt]: Result not set!")
	end

	return result.getDataInt(self:getID(), s)
end

function Result:getDataLong(s)
	if(self:getID() == -1) then
		error("[Result:getDataLong]: Result not set!")
	end

	return result.getDataLong(self:getID(), s)
end

function Result:getDataString(s)
	if(self:getID() == -1) then
		error("[Result:getDataString]: Result not set!")
	end

	return result.getDataString(self:getID(), s)
end

function Result:getDataStream(s)
	if(self:getID() == -1) then
		error("[Result:getDataStream]: Result not set!")
	end

	return result.getDataStream(self:getID(), s)
end

function Result:next()
	if(self:getID() == -1) then
		error("[Result:next]: Result not set!")
	end

	return result.next(self:getID())
end

function Result:free()
	if(self:getID() == -1) then
		error("[Result:free]: Result not set!")
	end

	local ret = result.free(self:getID())
	self:setID(-1)
	return ret
end

Result.numRows = Result.getRows
function db.getResult(query)
	if(type(query) ~= 'string') then
		return nil
	end

	local res = Result:new()
	res:setID(db.storeQuery(query))
	return res
end
 
edited my first post, so if you get the result not set error, check the buttom of my first post please.

all you have to do, is to replace your lib/database.lua with mine, which is improved by Colandus.

PHP:
if(result == nil) then
	print("> WARNING: Couldn't load database lib.")
	return
end

Result = createClass(nil)
Result:setAttributes({
	id = -1
})

function Result:getID()
	return self.id
end

function Result:setID(_id)
	self.id = _id
end

function Result:getQuery()
	return self.query
end

function Result:setQuery(_query)
	self.query = _query
end

function Result:create(_query)
	self:setQuery(_query)
	local _id = db.storeQuery(self:getQuery())
	if(_id) then
		self:setID(_id)
	end

	return self:getID()
end

function Result:getRows(free)
	if(self:getID() == -1) then
		error("[Result:getRows]: Result not set!")
	end

	local c = 0
	while true do
		if not self:next() then
			break
		end
		
		c = c + 1
	end

	if(free) then
		self:free()
	end

	return c
end

function Result:getDataInt(s)
	if(self:getID() == -1) then
		error("[Result:getDataInt]: Result not set!")
	end

	return result.getDataInt(self:getID(), s)
end

function Result:getDataLong(s)
	if(self:getID() == -1) then
		error("[Result:getDataLong]: Result not set!")
	end

	return result.getDataLong(self:getID(), s)
end

function Result:getDataString(s)
	if(self:getID() == -1) then
		error("[Result:getDataString]: Result not set!")
	end

	return result.getDataString(self:getID(), s)
end

function Result:getDataStream(s)
	if(self:getID() == -1) then
		error("[Result:getDataStream]: Result not set!")
	end

	return result.getDataStream(self:getID(), s)
end

function Result:next()
	if(self:getID() == -1) then
		error("[Result:next]: Result not set!")
	end

	return result.next(self:getID())
end

function Result:free()
	if(self:getID() == -1) then
		error("[Result:free]: Result not set!")
	end

	local ret = result.free(self:getID())
	self:setID(-1)
	return ret
end

Result.numRows = Result.getRows
function db.getResult(query)
	if(type(query) ~= 'string') then
		return nil
	end

	local res = Result:new()
	res:setID(db.storeQuery(query))
	return res
end
.thanks Lolandus = pr0
 
[24/08/2009 18:14:03] mysql_real_query(): SELECT `player_name` FROM `bounty_hunters` WHERE `player_name` = 'Jivaro' AND `kill_time` < 1 - MYSQL ERROR: Unknown column 'player_name' in 'field list' (1054)

I removed the scripts and I still get the error? -.-
 
im have errors ;/

[10/10/2009 21:55:17] Lua Script Error: [GlobalEvent Interface]
[10/10/2009 21:55:18] data/globalevents/scripts/shop.lua:eek:nThink

[10/10/2009 21:55:18] luaResultGetDataInt(). Result not found.

[10/10/2009 21:55:18] Lua Script Error: [GlobalEvent Interface]
[10/10/2009 21:55:18] data/globalevents/scripts/shop.lua:eek:nThink

[10/10/2009 21:55:18] luaResultGetDataString(). Result not found.

[10/10/2009 21:55:18] Lua Script Error: [GlobalEvent Interface]
[10/10/2009 21:55:18] data/globalevents/scripts/shop.lua:eek:nThink

[10/10/2009 21:55:18] luaResultGetDataInt(). Result not found.

[10/10/2009 21:55:18] Lua Script Error: [GlobalEvent Interface]
[10/10/2009 21:55:18] data/globalevents/scripts/shop.lua:eek:nThink

[10/10/2009 21:55:18] luaResultGetDataString(). Result not found.

[10/10/2009 21:55:18] Lua Script Error: [GlobalEvent Interface]
[10/10/2009 21:55:18] data/globalevents/scripts/shop.lua:eek:nThink

[10/10/2009 21:55:18] luaResultNext(). Result not found.

[10/10/2009 21:55:18] Lua Script Error: [GlobalEvent Interface]
[10/10/2009 21:55:18] data/globalevents/scripts/shop.lua:eek:nThink

[10/10/2009 21:55:18] luaResultFree(). Result not found.
 
im have errors ;/

[10/10/2009 21:55:17] Lua Script Error: [GlobalEvent Interface]
[10/10/2009 21:55:18] data/globalevents/scripts/shop.lua:eek:nThink

[10/10/2009 21:55:18] luaResultGetDataInt(). Result not found.

[10/10/2009 21:55:18] Lua Script Error: [GlobalEvent Interface]
[10/10/2009 21:55:18] data/globalevents/scripts/shop.lua:eek:nThink

[10/10/2009 21:55:18] luaResultGetDataString(). Result not found.

[10/10/2009 21:55:18] Lua Script Error: [GlobalEvent Interface]
[10/10/2009 21:55:18] data/globalevents/scripts/shop.lua:eek:nThink

[10/10/2009 21:55:18] luaResultGetDataInt(). Result not found.

[10/10/2009 21:55:18] Lua Script Error: [GlobalEvent Interface]
[10/10/2009 21:55:18] data/globalevents/scripts/shop.lua:eek:nThink

[10/10/2009 21:55:18] luaResultGetDataString(). Result not found.

[10/10/2009 21:55:18] Lua Script Error: [GlobalEvent Interface]
[10/10/2009 21:55:18] data/globalevents/scripts/shop.lua:eek:nThink

[10/10/2009 21:55:18] luaResultNext(). Result not found.

[10/10/2009 21:55:18] Lua Script Error: [GlobalEvent Interface]
[10/10/2009 21:55:18] data/globalevents/scripts/shop.lua:eek:nThink

[10/10/2009 21:55:18] luaResultFree(). Result not found.

rofl what does that has to do with the thread?
 
Last edited:
edited my first post, so if you get the result not set error, check the buttom of my first post please.

all you have to do, is to replace your lib/database.lua with mine, which is improved by Colandus.

PHP:
if(result == nil) then
	print("> WARNING: Couldn't load database lib.")
	return
end

Result = createClass(nil)
Result:setAttributes({
	id = -1
})

function Result:getID()
	return self.id
end

function Result:setID(_id)
	self.id = _id
end

function Result:getQuery()
	return self.query
end

function Result:setQuery(_query)
	self.query = _query
end

function Result:create(_query)
	self:setQuery(_query)
	local _id = db.storeQuery(self:getQuery())
	if(_id) then
		self:setID(_id)
	end

	return self:getID()
end

function Result:getRows(free)
	if(self:getID() == -1) then
		error("[Result:getRows]: Result not set!")
	end

	local c = 0
	while true do
		if not self:next() then
			break
		end
		
		c = c + 1
	end

	if(free) then
		self:free()
	end

	return c
end

function Result:getDataInt(s)
	if(self:getID() == -1) then
		error("[Result:getDataInt]: Result not set!")
	end

	return result.getDataInt(self:getID(), s)
end

function Result:getDataLong(s)
	if(self:getID() == -1) then
		error("[Result:getDataLong]: Result not set!")
	end

	return result.getDataLong(self:getID(), s)
end

function Result:getDataString(s)
	if(self:getID() == -1) then
		error("[Result:getDataString]: Result not set!")
	end

	return result.getDataString(self:getID(), s)
end

function Result:getDataStream(s)
	if(self:getID() == -1) then
		error("[Result:getDataStream]: Result not set!")
	end

	return result.getDataStream(self:getID(), s)
end

function Result:next()
	if(self:getID() == -1) then
		error("[Result:next]: Result not set!")
	end

	return result.next(self:getID())
end

function Result:free()
	if(self:getID() == -1) then
		error("[Result:free]: Result not set!")
	end

	local ret = result.free(self:getID())
	self:setID(-1)
	return ret
end

Result.numRows = Result.getRows
function db.getResult(query)
	if(type(query) ~= 'string') then
		return nil
	end

	local res = Result:new()
	res:setID(db.storeQuery(query))
	return res
end

When i use this not work comends, !frags etc. :(
TFS 0.3.5pl1
 
CREATE TABLE IF NOT EXISTS `bounty_hunters` (
`id` int(11) NOT NULL auto_increment,
`player_name` varchar(50) collate utf8_unicode_ci NOT NULL,
`hunted_by` varchar(50) collate utf8_unicode_ci NOT NULL,
`killed_by` varchar(11) collate utf8_unicode_ci NOT NULL,
`added` int(15) NOT NULL,
`prize` int(11) NOT NULL,
`kill_time` int(15) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;

i have to copy this code into any place or i have to add it manaully?
please answer me, im searching for the answer for many time
sorry for my english
 
i have to copy this code into any place or i have to add it manaully?
please answer me, im searching for the answer for many time
sorry for my english

you should add it in your mysql database in http://localhost/phpmyadmin then go to your server and then click on SQL. then you see a blank field where you can type things paste it there and click start AND DONE;d

Now my questioon xD
Is this compitable with OTServ 0.6.3 rev 5791 by pietia10 client version 860/861 ty Kasper
 
Back
Top