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

Server Crashing on Player Death

GiZmOz

New Member
Joined
Jul 19, 2009
Messages
97
Reaction score
2
Location
Unknown
I dont know why but every time a there is a death of a player it crashes the server. If anyone helps there is always rep =)
EDIT: Rev 0.3.6pl1 (8.54)
 
Last edited:
20 views and still no help ='(

EDIT: Error I get on console when player dies and crashes server
Code:
(luaGetCreatureName) Creature not found
 
Last edited:
post your codes onDeath and onKill and onPrepareDeath if you want some help becuse when cant find any wrong in an code that we cant see!
 
From what I see my servers folder has none of those mod that you mentioned (well at least from what folder im seeing) maybe its another folder or somewhere I can find.
 
The only script I have is playerdeath.lua which is this one
PHP:
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 = 0
		if killer == 0 then
			killerName = "field item"
		else
			if isPlayer(killer) == TRUE then
				byPlayer = 1
			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



50 views? No help? =(
 
Last edited:
Im pretty sure it has to be the data folder because the .exe is the latest Crying Damson rev 0.3.6pl1. Before I upgraded to 8.54 from 8.4 I had no problems with this dont know if there is a script for this problem.
 
you can help out yourself and those who might help you by actively trying stuff until you find what's the problem, since I don't think many others are having the same problem

we're not wizards and can't guess what you have wrong.
 
I understand what you mean. But I have tried a lot of things as you said to pinpoint found nothing to work with. Is there a way I can fix the bug by upgrading my server to 8.6? Btw thanks for all the help Cyko I really do appreciate it and im pretty sure PureDarkSlayer too.
 
try removing lines in creaturescripts.xml until you find the error maybe yo put a bad script there and crashes the ot ;S

look..
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>

<event type="login" name="PlayerLogin" event="script" value="login.lua"/>
<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
<event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>
<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>


<!-- Custom systems -->
<event type="death" name="PlayerDeath" event="script" value="playerdeath.lua"/>
<event type="death" name="DeathBroadcast" script="deathBroadcast.lua"/>
<event type="kill" name="MonsterPortal" event="script" value="portals.lua"/>
<event type="kill" name="MonsterPortal2" event="script" value="snaketp.lua"/>
<event type="kill" name="MonsterPortal3" event="script" value="boogeytp.lua"/>
<event type="advance" name="Advance" event="script" value="Advance.lua"/>
<event type="kill" name="Killb" event="script" value="killb.lua"/>
<event type="death" name="Reward" event="script" value="reward.lua"/>
</creaturescripts>

try removing some lines, you now things like when you die appears a text pwned or a reward script..
 
Ok I will try that out and come back with some feedback =)

EDIT: Tried what you said but still crashes.
 
Last edited:
Back
Top