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

C++ Force player to disconnect upon death

Joriku

Working in the mines, need something?
Joined
Jul 16, 2016
Messages
1,085
Solutions
15
Reaction score
379
Location
Sweden
YouTube
Joriku
Hi,
I know nothing about C++, sadly.

How would I force a player to disconnect upon death?
The reason is that once my character is dead, the onLogin script is not taking place which is going to re-add level up to 120. This does not happen unless the player manually re-logs.
I tried using player:remove() inside player_death but it gave no results.

Trying to add a force disconnection when the player is dead for onLogin scripts to take place.

So, instead of removePlayer. Is there a way to force disconnection upon the player? (c++ wise)

This happens with removePlayer
image.png


Using disconnect();
Gives this and the onLogin event takes place, player is re-added onto 120.
However, this is simply not a enter click to re-enter the game, so death after death will become annoying. Is there a better way of using this to force the onLogin function to take place?
Like a force logout instead?
1667970414216.png
 
Last edited:
Check if the player is logged, if it's not, keep trying to log him out until player is not logged!
have you tried with prepareDeath?

Lua:
while getPlayerName(cid) ~= nil do
    doRemoveCreature(cid)
    if not isCreature(cid) then
        -- You can perform actions here while the player is logged off
        -- I'm using this loop whenever I need to make changes to the database
        -- Also try to understand the concept here, don't just copy and paste :)
        break
    end
end
 
Back
Top