Sign in to follow this  
Vennox

[JS] Server crashing when player disconnects

Recommended Posts

When the player disconnects (either client crashes or kick from the server), the server crashes showing this:

Error: async hook stack has become corrupted (actual: 141, expected: 18)

followed by this:

oeXjjEC.png

 

I thought it was because of this event:

mp.events.add("playerQuit", (player) => {
    if(player.loggedInAs != ""){
        gm.auth.saveAccount(player);
    }
});

But i removed it and the problem persists.

Note: i started my gamemode from this one - 

Any help is appreciated, thank you

Share this post


Link to post
Share on other sites

You probably have an interval/timeout or an async callback that uses an expired player object causing this crash. Use mp.player.exists(playerObj).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.