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

Problem when a player dies [0.3.7][0.3.r5928][9.81]

Pnurt

New Member
Joined
Apr 22, 2009
Messages
205
Reaction score
0
So I'm having this issue when a player dies, he never gets kicked from the server like you are supposed to.

The "Your are dead." windows stays up and after a while you get "Connection lost" (or something like that) and then you get kicked. After that you have to login again and once you are logged in, your backpack that you died and lost is open in a window. You can't do anything with it and you don't actually have the backpack on you.

So this isn't something that destroys my server in any way but it would be nice to fix as it would confuse a lot of people.


Wangsta said this
You could make a creaturescript onDeath using doRemoveCreature.


Anyone could help me out here?

*******************************************************************
EDIT:

For everyone that needs a fix have a look at this!!

http://otland.net/project.php?issueid=2419#note13459
 
Last edited:
Set this as death script.

Lua:
function deathKick(cid)
	doRemoveCreature(cid)
end

function onDeath(cid, corpse)
	addEvent(deathKick, 0, cid)
	return true
end

For the addEvent the 0 is the time before it executes

So say it doesn't work try adding 100 to it which is 1/10th of a second before acting

1000 is a full second

And don't for get to register the creaturevent in login.lua

Tested with both 0, 100 and 1000. All of them giving me the same error

Code:
[14:23:56.651] [Error - CreatureScript Interface]
[14:23:56.653] In a timer event called from:
[14:23:56.655] data/creaturescripts/scripts/deathfix.lua:onDeath
[14:23:56.657] Description:
[14:23:56.658] (LuaInterface::luaDoRemoveCreature) Creature not found
 
That is just odd, this all worked before you lost the files you recovered and now it doesn't work, is the death list enabled or disabled different from before? I'm not sure how it is this issue could happen unless its a bug with something like allow clones in config or death list, it must be a source issue and one of the configs is enabling this bug

The server is obviously recognizing the players death but not properly saving its death and on reconnect it thinks that the player is online due to the online status of the database.
 
Yeah

When a player dies:
A corpse is being created with the correct names and killer names etc. Just as it should.
Everything freezes and you can't move. Just as it should.
The "You are dead" window pops up. But when you click "Ok", you don't get kicked. Nothing happens. The pop-up dissapears and you only see your dead body at the spot you died. You don't get kicked. If you are fast you can do Ctrl + Q to logout and then log back in like normal. Else if you wait you will get smth like "Game server not responding" or smth like that.
 
Yeah

When a player dies:
A corpse is being created with the correct names and killer names etc. Just as it should.
Everything freezes and you can't move. Just as it should.
The "You are dead" window pops up. But when you click "Ok", you don't get kicked. Nothing happens. The pop-up dissapears and you only see your dead body at the spot you died. You don't get kicked. If you are fast you can do Ctrl + Q to logout and then log back in like normal. Else if you wait you will get smth like "Game server not responding" or smth like that.

I've got the same problem mate. I can't fix it xd.
 
So basically it's just not teleporting you to temple?

Be sure temple position is set proper for players town id

If so then just try adding teleport to temple to onDeath script
 
So basically it's just not teleporting you to temple?

Be sure temple position is set proper for players town id

If so then just try adding teleport to temple to onDeath script

It is teleporting you to temple.

The problem is that the player never gets kicked after death.
You are supposed to be kicked after death right? But this just doesnt kick you.

- - - Updated - - -

I messaged Wangsta again and he told me this
You can patch over the death related code from 0.2, I haven't had time to add it yet.


I have no idea on how to do that. Ofc I can edit my source-files but it feels like I'm gonna miss or break something.

Help?
 
Back
Top