From e9bf8907728a8ba2886a43a126c4e940178d4a5b Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 4 Sep 2022 15:52:27 -0500 Subject: [PATCH] Manually call spawn event for IV and Mafia 1 --- scripts/server/subaccount.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/server/subaccount.js b/scripts/server/subaccount.js index d731ff38..50ef6712 100644 --- a/scripts/server/subaccount.js +++ b/scripts/server/subaccount.js @@ -528,22 +528,24 @@ function selectCharacter(client, characterId = -1) { //setPlayerDimension(client, spawnDimension); restorePlayerCamera(client); setPlayerSkin(client, skin); + setTimeout(function () { + onPlayerSpawn(client); + //stopRadioStreamForPlayer(client); + }, 500); } else if (getGame() == AGRP_GAME_MAFIA_ONE) { //spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0]); //logToConsole(LOG_DEBUG, `[VRR.SubAccount] Spawning ${getPlayerDisplayForConsole(client)} as ${getGameConfig().skins[getGame()][skin][1]} (${getGameConfig().skins[getGame()][skin][0]})`); spawnPlayer(client, spawnPosition, spawnHeading, getGameConfig().skins[getGame()][skin][0]); + setTimeout(function () { + onPlayerSpawn(client); + //stopRadioStreamForPlayer(client); + }, 250); } removePlayerKeyBind(client, getKeyIdFromParams("insert")); logToConsole(LOG_DEBUG, `[VRR.SubAccount] Spawned ${getPlayerDisplayForConsole(client)} as character ID ${getPlayerData(client).currentSubAccount} with skin ${skin} (${spawnPosition.x}, ${spawnPosition.y}, ${spawnPosition.z})`); - setTimeout(function () { - onPlayerSpawn(client); - }, 500); - - stopRadioStreamForPlayer(client); - getPlayerCurrentSubAccount(client).lastLogin = getCurrentUnixTimestamp(); }