[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 '{'
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 = pr0edited 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
For what u need the "string.lower(hunt) ~= string.lower(getCreatureName(cid))"??
im have errors ;/
[10/10/2009 21:55:17] Lua Script Error: [GlobalEvent Interface]
[10/10/2009 21:55:18] data/globalevents/scripts/shop.luanThink
[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.luanThink
[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.luanThink
[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.luanThink
[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.luanThink
[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.luanThink
[10/10/2009 21:55:18] luaResultFree(). Result not found.
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
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