Inne Nie mog? da? look na siebie i innych graczy.

Status
Zamknięty.

Markeer24

Advanced User
Zarejestrowany
Dołączył
Styczeń 6, 2011
Posty
416
Liczba reakcji
41
Wiek
29
Witam,
Mam problem bowiem gdy daje "look" w grze na siebie b?d? innego playera nic si? nie dzieje. Na wszystkie inne rzeczy 'look' dzia?a poprawnie.
W konsoli wy?wietla si?
Kod:
[20/10/2013 21:21:27] mysql_real_query(): SELECT `rep` FROM `players` WHERE `id` = 2 LIMIT 1 - MYSQL ERROR: Unknown column 'rep' in 'field list' (1054)

[20/10/2013 21:21:27] [Error - CreatureScript Interface] 
[20/10/2013 21:21:27] data/creaturescripts/scripts/rep/repLook.lua:onLook
[20/10/2013 21:21:27] Description: 
[20/10/2013 21:21:27] data/lib/004-database.lua:60: [Result:getDataInt] Result not set!
[20/10/2013 21:21:27] stack traceback:
[20/10/2013 21:21:27] 	[C]: in function 'error'
[20/10/2013 21:21:27] 	data/lib/004-database.lua:60: in function 'getDataInt'
[20/10/2013 21:21:27] 	data/lib/050-function.lua:667: in function 'getRepPoints'
[20/10/2013 21:21:27] 	data/creaturescripts/scripts/rep/repLook.lua:8: in function <data/creaturescripts/scripts/rep/repLook.lua:5>

OTS'a pobra?em z http://tibia.net.pl/threads/394270-8-60-Alissow-OTs-4-11!

Mo?e spowodowane jest to systemem reputacji, kt?ry funkcjonuje na serverze. Je?li tak czy kto? m?g?by powiedzie? jak go wy??czy? (jestem w to zielony :|), wszelk? pomoc nagradzam reputacj?.

Dzi?ki, pozdrawiam.
 
Odp: Nie mog? da? look na siebie i innych graczy.

Nie masz kolumny "rep" w tabelach "players" (oczywi?cie w bazie danych)
 
Odp: Nie mog? da? look na siebie i innych graczy.

a najlepiej wywal ten skrypt z creaturescripts
 
Odp: Nie mog? da? look na siebie i innych graczy.

@UP

Tak jak napisa?e? wywali?em ca?y rep z creaturescript ale b??d dalej jest

Kod:
[21/10/2013 13:36:29] mysql_real_query(): SELECT `rep` FROM `players` WHERE `id` = 2; - MYSQL ERROR: Unknown column 'rep' in 'field list' (1054)

[21/10/2013 13:36:29] [Error - CreatureScript Interface] 
[21/10/2013 13:36:29] buffer:onLook
[21/10/2013 13:36:29] Description: 
[21/10/2013 13:36:29] data/lib/004-database.lua:60: [Result:getDataInt] Result not set!
[21/10/2013 13:36:29] stack traceback:
[21/10/2013 13:36:29] 	[C]: in function 'error'
[21/10/2013 13:36:29] 	data/lib/004-database.lua:60: in function 'getDataInt'
[21/10/2013 13:36:29] 	[string "rep = {..."]:16: in function 'getPoints'
[21/10/2013 13:36:29] 	[string "loadBuffer"]:4: in function <[string "loadBuffer"]:2>

W sumie zale?y mi najbardziej na wywaleniu tego skrypta, wi?c jak kto? wie jak to zrobi? to prosz? napisa?.
 
Odp: Nie mog? da? look na siebie i innych graczy.

daj data/lib/004-database.lua
 
Odp: Nie mog? da? look na siebie i innych graczy.

Prosze ;p

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

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

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)
	local free = free or false
	if(self:getID() == -1) then
		error("[Result:getRows] Result not set!")
	end

	local c = 0
	repeat
		c = c + 1
	until not self:next()

	local _query = self:getQuery()
	self:free()
	if(not free) then
		self:create(_query)
	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

	self:setQuery("")
	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 ret = Result:new()
	ret:create(query)
	return ret
end
 
Status
Zamknięty.
Back
Do góry