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

Death without 'Dead Human' o.o

dukzin

New Member
Joined
Aug 18, 2008
Messages
161
Reaction score
3
Death Bug..
When you die dont appears the corpse and give that errors on console.

Errors.
Code:
[22/06/2010 16:12:30] [Error - CreatureScript Interface] 
[22/06/2010 16:12:30] data/creaturescripts/scripts/playerdeath.lua:onDeath
[22/06/2010 16:12:30] Description: 
[22/06/2010 16:12:30] (luaGetCreatureName) Creature not found
[22/06/2010 16:12:30] mysql_real_query(): INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (3, 1277233950, 180, '', ''); - MYSQL ERROR: Unknown column 'time' in 'field list' (1054)
[22/06/2010 16:12:30] mysql_real_query(): DELETE FROM `player_deaths` WHERE `player_id` = 3 ORDER BY `time` LIMIT 10; - MYSQL ERROR: Unknown column 'time' in 'order clause' (1054)
[22/06/2010 16:12:30] Doritos Pop has logged out.
[22/06/2010 16:12:31] Doritos Pop has logged in.

PlayerDeath Script.
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`, `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: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 `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

Creature scripts.
Code:
<?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="think" name="Idle" event="script" value="idle.lua"/>

	<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>

	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>

	<event type="advance" name="AdvanceSave" script="advancesave.lua"/>
	<event type="login" name="FimVip" event="script" value="vip2.lua"/>

	<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>

<event type="kill" name="InquisitionBosses" event="script" value="inquistion.lua"/>

	<event type="death" name="Pythius the rottenTeleport" script="Pythius the rotten_teleport.lua"/>

	<event type="death" name="inquisitionPortals" script="inquisitionPortals.lua"/>

     <event type="login" name="PlayerLogin" event="script" value="anti magebomb.lua"/>

</creaturescripts>

Login script.
Code:
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandle r'))
}

function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end

local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end

if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end


registerCreatureEvent(cid, "InquisitionBosses")
registerCreatureEvent(cid, "Pythius the rottenTeleport")

registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "AdvanceSave")

registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "inquisitionPortals")

registerCreatureEvent(cid, "Idle")
registerCreatureEvent(cid, "SkullCheck")
registerCreatureEvent(cid, "SaveReportBug")
return true
end

Please Help Me.
:/
 
Last edited:
Execute query in phpMyAdmin:
Code:
ALTER TABLE `player_deaths` ADD `time` bigint(20) unsigned NOT NULL DEFAULT 0;
 
New error.

Code:
[22/06/2010 16:46:16] [Error - CreatureScript Interface] 
[22/06/2010 16:46:16] data/creaturescripts/scripts/playerdeath.lua:onDeath
[22/06/2010 16:46:16] Description: 
[22/06/2010 16:46:16] (luaGetCreatureName) Creature not found
[22/06/2010 16:46:16] mysql_real_query(): INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (14, 1277235976, 148, '', ''); - MYSQL ERROR: Unknown column 'killed_by' in 'field list' (1054)
 
[22/06/2010 18:17:41] [Error - CreatureScript Interface]
[22/06/2010 18:17:41] data/creaturescripts/scripts/playerdeath.lua:eek:nDeath
[22/06/2010 18:17:41] Description:
[22/06/2010 18:17:41] (luaGetCreatureName) Creature not found

new error.

tfs 0.3.6

if i delete this script as the normal tfs it gives no error but dosn't have corpse (dead human).
and doesn't lost items.
 
Last edited:
reupload creaturescripts entire file from the original TFS

show your creaturescript and login.lua or write on gadu 10874160
 
Creaturescripts.
Code:
<?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="think" name="Idle" event="script" value="idle.lua"/>

	<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>

	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>

	<event type="advance" name="AdvanceSave" script="advancesave.lua"/>
	<event type="login" name="FimVip" event="script" value="vip2.lua"/>

	<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>

<event type="kill" name="InquisitionBosses" event="script" value="inquistion.lua"/>

	<event type="death" name="Pythius the rottenTeleport" script="Pythius the rotten_teleport.lua"/>

	<event type="death" name="inquisitionPortals" script="inquisitionPortals.lua"/>

     <event type="login" name="PlayerLogin" event="script" value="anti magebomb.lua"/>

</creaturescripts>

what's Gadu 108... ?

edit- on it dont have the line of playerdeath cuz it gives alot of errors. and without it has the same bug but without errors.
 
Replace the your creaturescripts on
<creaturescripts>
<event type="login" name="PlayerLogin" event="script" value="login.lua"/>


<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>

<event type="think" name="Idle" event="script" value="idle.lua"/>
<event type="receivemail" name="Mail" event="script" value="mail.lua"/>

<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>

<event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>

<event type="think" name="Idle" event="script" value="idle.lua"/>

<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>

<event type="advance" name="AdvanceSave" script="advancesave.lua"/>
<event type="login" name="FimVip" event="script" value="vip2.lua"/>
<event type="kill" name="InquisitionBosses" event="script" value="inquistion.lua"/>
<event type="death" name="Pythius the rottenTeleport" script="Pythius the rotten_teleport.lua"/>
<event type="death" name="inquisitionPortals" script="inquisitionPortals.lua"/>
<event type="login" name="PlayerLogin" event="script" value="anti magebomb.lua"/>

</creaturescripts>

When will not work, try
<event type="login" name="PlayerLogin" event="script" value="login.lua"/>


<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>

<event type="think" name="Idle" event="script" value="idle.lua"/>
<event type="receivemail" name="Mail" event="script" value="mail.lua"/>

<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>

<event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>

<event type="think" name="Idle" event="script" value="idle.lua"/>

<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>

<event type="login" name="FimVip" event="script" value="vip2.lua"/>
<event type="kill" name="InquisitionBosses" event="script" value="inquistion.lua"/>
<event type="death" name="Pythius the rottenTeleport" script="Pythius the rotten_teleport.lua"/>
<event type="death" name="inquisitionPortals" script="inquisitionPortals.lua"/>
<event type="login" name="PlayerLogin" event="script" value="anti magebomb.lua"/>

</creaturescripts>
if it does not work show me your login.lua
 
don't wok...

login.
Code:
local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end
	
    registerCreatureEvent(cid, "InquisitionBosses")
	registerCreatureEvent(cid, "Pythius the rottenTeleport")
	
	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "AdvanceSave")
	
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "inquisitionPortals")
	
	registerCreatureEvent(cid, "Idle")
    registerCreatureEvent(cid, "SkullCheck")
	registerCreatureEvent(cid, "SaveReportBug")
	return true
end


HELP ME, THE SERVER IS ON :/
 
Replace your login.lua on this
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end

local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end

if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end


registerCreatureEvent(cid, "InquisitionBosses")
registerCreatureEvent(cid, "Pythius the rottenTeleport")

registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "AdvanceSave")

registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "inquisitionPortals")

registerCreatureEvent(cid, "Idle")
registerCreatureEvent(cid, "SkullCheck")
registerCreatureEvent(cid, "SaveReportBug")
return true
end
You server is TFs 0.3.6 ?
 
didn't work...

will try to recompile the exe

Recompilled using 0.3.6 pl1 sources.
Bug continue!

will edit first post with all scripts.

- EDITED First Post.
 
Last edited:
In TFS 0.3.6 playerdeath.lua in creaturescripts is not needed because it is probably written in C + +
that is, so I heard
 
Back
Top