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

[8.7] The Forgotten Server v0.2.9 (Mystic Spirit)

Status
Not open for further replies.
Lua:
dofile("./config.lua")

function onDeath(cid, corpse, killer)
	doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You are dead.")
	if deathListEnabled == "yes" then
		if sqlType == "mysql" then
			env = luasql.mysql()
			sql = env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort)
		else -- sqlite
			env = luasql.sqlite3()
			sql = env:connect(sqliteDatabase)
		end
		local byPlayer = FALSE
		if killer == FALSE then
			killerName = "field item"
		else
			if isPlayer(killer) == TRUE then
				byPlayer = TRUE
			end
			killerName = getCreatureName(killer)
		end
		sql:execute("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", '" .. escapeString(killerName) .. "', " .. byPlayer .. ");")
		local result = sql:execute("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")
		local deathRecords = numRows(result)
		if sqlType == "mysql" then
			while deathRecords > maxDeathRecords do
				delete = sql:execute("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1;")
				deathRecords = deathRecords - 1
			end
		else
			while deathRecords > maxDeathRecords do
				delete = sql:execute("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);")
				deathRecords = deathRecords - 1
			end
		end			
		sql:close()
		env:close()
	end
end

fix this script becouse it making error:

Code:
[14/01/2011 05:46:47] Lua Script Error: [CreatureScript Interface] 
[14/01/2011 05:46:47] data/creaturescripts/scripts/playerdeath.lua:onDeath
[14/01/2011 05:46:47] data/creaturescripts/scripts/playerdeath.lua:26: attempt to concatenate local 'byPlayer' (a boolean value)
[14/01/2011 05:46:48] stack traceback:
[14/01/2011 05:46:48] 	[C]: in function '__concat'
[14/01/2011 05:46:48] 	data/creaturescripts/scripts/playerdeath.lua:26: in function <data/creaturescripts/scripts/playerdeath.lua:3>
i self know how to fix it but i am too lazy this is tfs team issue.
 
My database got bugged and isnt saving any player
ERROR MSG: DATABASE DISK IMAGE IS MALFORMED

Anyone knows how i can fix it ?
 
You got virus

I'm free of virus 100% sure...
It got bugged when server tried to add players into the house_lists, more than its limit, so rows look like this: Player1n///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Player2////////////////////////////////

and i can't delete the bugged row. =X
 
have anyone tried to compile it and with what program you compiled it i tried with stian and talaturen compilers but didint worked, so did anyone?
 
can someone tell me the reason why beholder and undead legion spell were removed?
 
I got this error.
cc1plus: warnings being treated as errors
otserv.cpp: In function ‘void badAllocationHandler()’:
otserv.cpp:237: error: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with attribute warn_unused_result
make: *** [otserv.o] Błąd 1
Someone can help me?
 
can someone tell me the reason why beholder and undead legion spell were removed?

Beholder has been renamed (beholders placed on your map will spawn with new name, so you don't have to touch anything).
Undead Legion no longer exists in Tibia.

I got this error.

Someone can help me?

You can comment out that line by adding two slashes (//) infront of the line, the error has been fixed in 0.2.10.
 
Status
Not open for further replies.
Back
Top