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

Error in Database .-.

picachu

Member
Joined
Dec 2, 2007
Messages
970
Reaction score
11
Hello people
This is the third time i had this FUCKING ERROR ! :mad::mad::mad:
I'm crazy with that error >.>
That's the third time i get this fucking error and had to reset the server ¬¬
The error is:

Code:
General error: 145 Table '.\eyed\players' is marked as crashed and should be repaired
Please, help! :(
I Rep++ 3x
 
OMG
I love you so much :O

Another error now, [ not in database, but ingame when die ]

Code:
[01/11/2009 20:47:56] Lua Script Error: [CreatureScript Interface] 
[01/11/2009 20:47:56] data/creaturescripts/scripts/playerdeath.lua:onDeath

[01/11/2009 20:47:56] luaGetCreatureName(). Creature not found

[01/11/2009 20:47:56] Lua Script Error: [CreatureScript Interface] 
[01/11/2009 20:47:57] data/creaturescripts/scripts/playerdeath.lua:onDeath

[01/11/2009 20:47:57] luaGetCreatureName(). Creature not found

[01/11/2009 20:47:57] Lua Script Error: [CreatureScript Interface] 
[01/11/2009 20:47:57] data/creaturescripts/scripts/playerdeath.lua:onDeath

[01/11/2009 20:47:57] luaGetCreatureName(). Creature not found
[01/11/2009 20:47:57] mysql_real_query(): INSERT INTO `player_deaths` (`player_id`, `date`, `level`, `killed_by`, `altkilled_by`) VALUES (1205, 1257115677, 8, '', ''); - MYSQL ERROR: Unknown column 'killed_by' in 'field list' (1054)
 
PHP:
ALTER TABLE `player_deaths` ADD COLUMN `killed_by` VARCHAR(255) NOT NULL COMMENT 'last hit killer';
 
The error continues
i fixed xD
i SQL your query, and mine one, and it fixed.
but one error continues
its:

Code:
[01/11/2009 21:05:47] Lua Script Error: [CreatureScript Interface] 
[01/11/2009 21:05:47] data/creaturescripts/scripts/playerdeath.lua:onDeath

[01/11/2009 21:05:47] luaGetCreatureName(). Creature not found

[01/11/2009 21:05:47] Lua Script Error: [CreatureScript Interface] 
[01/11/2009 21:05:47] data/creaturescripts/scripts/playerdeath.lua:onDeath

[01/11/2009 21:05:47] luaGetCreatureName(). Creature not found

[01/11/2009 21:05:47] Lua Script Error: [CreatureScript Interface] 
[01/11/2009 21:05:47] data/creaturescripts/scripts/playerdeath.lua:onDeath

[01/11/2009 21:05:47] luaGetCreatureName(). Creature not found
 
Yes i used your MySQL Query and mine one...
And it's ok now
But, the first error continues
It's:

Code:
[01/11/2009 21:05:47] Lua Script Error: [CreatureScript Interface] 
[01/11/2009 21:05:47] data/creaturescripts/scripts/playerdeath.lua:onDeath

[01/11/2009 21:05:47] luaGetCreatureName(). Creature not found

[01/11/2009 21:05:47] Lua Script Error: [CreatureScript Interface] 
[01/11/2009 21:05:47] data/creaturescripts/scripts/playerdeath.lua:onDeath

[01/11/2009 21:05:47] luaGetCreatureName(). Creature not found

[01/11/2009 21:05:47] Lua Script Error: [CreatureScript Interface] 
[01/11/2009 21:05:47] data/creaturescripts/scripts/playerdeath.lua:onDeath

[01/11/2009 21:05:47] luaGetCreatureName(). Creature not found
 
I'm using TFS 0.3.5pl1.
My playerdeath:

Code:
local config = {
	deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
	sqlType = getConfigInfo('sqlType'),
	maxDeathRecords = getConfigInfo('maxDeathRecords')
}

config.sqlType = config.sqlType == "sqlite" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
	if(config.deathListEnabled ~= TRUE) then
		return
	end

	local hitKillerName = "field item"
	local damageKillerName = ""
	if(lastHitKiller ~= FALSE) then
		if(isPlayer(lastHitKiller) == TRUE) then
			hitKillerName = getPlayerGUID(lastHitKiller)
		else
			hitKillerName = getCreatureName(lastHitKiller)
		end

		if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then
			if(isPlayer(mostDamageKiller) == TRUE) then
				damageKillerName = getPlayerGUID(mostDamageKiller)
			else
				damageKillerName = getCreatureName(mostDamageKiller)
			end
		end
	end

	db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `date`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");")
	local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")
	if(rows:getID() ~= -1) then
		local amount = rows:getRows(true) - config.maxDeathRecords
		if(amount > 0) then
			if(config.sqlType == DATABASE_ENGINE_SQLITE) then
				for i = 1, amount do
					db.executeQuery("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `date` LIMIT 1);")
				end
			else
				db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `date` LIMIT " .. amount .. ";")
			end
		end
	end
end

Thank you for helping ok? :D The code ^
 
Try this one.
Lua:
local config = {
    deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
    sqlType = getConfigInfo('sqlType'),
    maxDeathRecords = getConfigInfo('maxDeathRecords')
}

config.sqlType = config.sqlType == "sqlite" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
    if(config.deathListEnabled ~= TRUE) then
        return
    end

    local hitKillerName = "field item"
    local damageKillerName = ""
    if(lastHitKiller ~= 0) then
        if(isPlayer(lastHitKiller) == TRUE) then
            hitKillerName = getPlayerGUID(lastHitKiller)
        else
            hitKillerName = getCreatureName(lastHitKiller)
        end

        if(mostDamageKiller ~= 0 and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then
            if(isPlayer(mostDamageKiller) == TRUE) then
                damageKillerName = getPlayerGUID(mostDamageKiller)
            else
                damageKillerName = getCreatureName(mostDamageKiller)
            end
        end
    end

    db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `date`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");")
    local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")
    if(rows:getID() ~= -1) then
        local amount = rows:getRows(true) - config.maxDeathRecords
        if(amount > 0) then
            if(config.sqlType == DATABASE_ENGINE_SQLITE) then
                for i = 1, amount do
                    db.executeQuery("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `date` LIMIT 1);")
                end
            else
                db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `date` LIMIT " .. amount .. ";")
            end
        end
    end
end
 
when player dies:

Lua:
[01/11/2009 21:35:10] Lua Script Error: [CreatureScript Interface] 
[01/11/2009 21:35:10] data/creaturescripts/scripts/playerdeath.lua:onDeath

[01/11/2009 21:35:10] luaGetCreatureName(). Creature not found

[01/11/2009 21:35:10] Lua Script Error: [CreatureScript Interface] 
[01/11/2009 21:35:10] data/creaturescripts/scripts/playerdeath.lua:onDeath

[01/11/2009 21:35:10] luaGetCreatureName(). Creature not found

[01/11/2009 21:35:10] Lua Script Error: [CreatureScript Interface] 
[01/11/2009 21:35:10] data/creaturescripts/scripts/playerdeath.lua:onDeath

[01/11/2009 21:35:10] luaGetCreatureName(). Creature not found
.
 
I'm not sure what causes it then since the error isn't really telling me a line to search at, and I do not have a server of my own to test it at.

I'd recommend you to do some basic searching through the forum. Before you do that, you might want to give this post a try though.

http://otland.net/422548-post4.html
 
It doesn't work :s
If you find anything please post here.
I will try to find too.
Thanks for help, sorry for wast your time with me.
 
Back
Top