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

Windows Clean Server Error's

Teddy

SweStream.se
Joined
Oct 2, 2008
Messages
3,797
Reaction score
10
Location
Sweden 172
Hello i going to clean some errors in my console (no errors make any problem but i dont like spam error some time's)

First Error (when 1 player go into training room this error come in console , PS : the training system work but i dont like errors)

Code:
[01/06/2009 11:06:28] Lua Script Error: [Action Interface] 
[01/06/2009 11:06:28] data/actions/scripts/booths/training/east.lua:onUse

[01/06/2009 11:06:28] luaDoRemoveCreature(). Creature not found

[01/06/2009 11:06:28] Lua Script Error: [Action Interface] 
[01/06/2009 11:06:28] data/actions/scripts/booths/training/east.lua:onUse

[01/06/2009 11:06:28] luaDoRemoveCreature(). Creature not found

here are the script :
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)


    -- Define positions.
    local charPos = getCreaturePosition(cid)
    local doorPos = getThingPos(item.uid)
    local monkOne = {x = doorPos.x + 2, y = doorPos.y - 1, z = doorPos.z}
    local monkTwo = {x = doorPos.x + 2, y = doorPos.y + 1, z = doorPos.z}
    local checkPlayer = {x = doorPos.x + 1, y = doorPos.y, z = doorPos.z, stackpos = 253}
    -- Define directions.
    local newDir  = 1
    local oldDir  = 3
    
    -- Check where the player is located at.
    if ( charPos.x == doorPos.x - 1 and charPos.z == doorPos.z ) then
        -- Check if someone already uses the training booth.
        if isPlayer(getThingfromPos(checkPlayer).uid) == TRUE then
            doPlayerSendTextMessage(cid, 24, "Someone is already using this booth.")
            doSendMagicEffect(getCreaturePos(cid), 2)
        else
            -- Teleport player.
            doTeleportThing(cid, doorPos)
            doMoveCreature(cid, newDir)
            -- Summon training monks.
            doSummonCreature("Training Monk", monkOne)
            doSummonCreature("Training Monk", monkTwo)
        end
    else
        -- Teleport player.
        doTeleportThing(cid, doorPos)
        doMoveCreature(cid, oldDir)
        -- Remove training monks.
        doRemoveCreature(getThingfromPos({x = monkOne.x, y = monkOne.y, z = monkOne.z, stackpos = 253}).uid)
        doRemoveCreature(getThingfromPos({x = monkTwo.x, y = monkTwo.y, z = monkTwo.z, stackpos = 253}).uid)
        -- Send magic effect.
        doSendMagicEffect(monkOne, 2)
        doSendMagicEffect(monkTwo, 2)
        -- Define last character.
        local charName = getCreatureName(cid)
        doSetItemSpecialDescription(getThingfromPos(doorPos).uid, "Last one to use this booth was player:\n" .. charName .. ".")
    end
    return TRUE

end


Error nr 2 ..
Sometimes when a player die on my server this error come (SOMETIME'S NOT ALWAYS)

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

[01/06/2009 11:09:01] luaGetCreatureName(). Creature not found

[01/06/2009 11:09:01] Lua Script Error: [CreatureScript Interface] 
[01/06/2009 11:09:01] data/creaturescripts/scripts/playerdeath.lua:onDeath

[01/06/2009 11:09:01] luaGetCreatureName(). Creature not found

Script :
Code:
local config = {
	deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
	sqlType = getConfigInfo('sqlType'),
	maxDeathRecords = getConfigInfo('maxDeathRecords')
}
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
	if(config.deathListEnabled == TRUE) then
		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`, `time`, `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:numRows(true) - config.maxDeathRecords)
			if(amount > 0) then
				if(config.sqlType == "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 `time` LIMIT 1);")
					end
				else
					db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";")
				end
			end
		end
	end
end


Error nr 3 (when i start the server this error come ?) FIXED !!
Code:
[01/06/2009 11:00:23] mysql_real_query(): INSERT INTO `server_motd` (`id`, `world_id`, `text`) VALUES (305, 0, 'Welcome to the sweddy!'); - MYSQL ERROR: Table 'lol.server_motd' doesn't exist (1146)

There are all errors i give rep for helping me ! :)
 
Last edited:
Nr 3 fix : added this to DB
CREATE TABLE `server_motd`
(
`id` INT UNSIGNED NOT NULL,
`world_id` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
`text` TEXT NOT NULL,
UNIQUE (`id`, `world_id`)
) ENGINE = InnoDB;

INSERT INTO `server_motd` VALUES (1, 0, 'Welcome to Sweddy!');
can some help me whit the other errors ?
 
Back
Top