From 09316c3301bde038a333a26ac0790f76c3c2a319 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 4 Sep 2022 15:51:03 -0500 Subject: [PATCH] Don't announce job route stop on player quit --- scripts/server/event.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/server/event.js b/scripts/server/event.js index 767d0910..5ee60347 100644 --- a/scripts/server/event.js +++ b/scripts/server/event.js @@ -120,7 +120,7 @@ function onPlayerQuit(event, client, quitReasonId) { } if (isPlayerOnJobRoute(client)) { - stopJobRoute(client); + stopJobRoute(client, false, false); } if (isPlayerWorking(client)) { @@ -136,17 +136,17 @@ function onPlayerQuit(event, client, quitReasonId) { clearTimeout(getPlayerData(client).loginTimeout); } - playerResourceReady[client.index] = false; - playerResourceStarted[client.index] = false; - playerInitialized[client.index] = false; - playerGUIReady[client.index] = false; - messageDiscordEventChannel(`👋 ${getPlayerName(client)} has left the server (${reasonText})`); getClients().forEach(forClient => { let reasonText = getGroupedLocaleString(forClient, "DisconnectReasons", quitReasonId); messagePlayerNormal(forClient, getLocaleString(forClient, "PlayerLeftServer", getPlayerName(client), reasonText)); }); + playerResourceReady[client.index] = false; + playerResourceStarted[client.index] = false; + playerInitialized[client.index] = false; + playerGUIReady[client.index] = false; + getServerData().clients[getPlayerId(client)] = null; } @@ -394,8 +394,10 @@ function onPlayerDeath(client, killer, weapon, pedPiece) { function onPedSpawn(ped) { if (ped.type == ELEMENT_PLAYER) { - //setTimeout(onPlayerSpawn, 250, ped); - onPlayerSpawn(); + if (getGame() != AGRP_GAME_MAFIA_ONE && getGame() != AGRP_GAME_GTA_IV) { + //setTimeout(onPlayerSpawn, 250, ped); + onPlayerSpawn(); + } } }