diff --git a/scripts/server/subaccount.js b/scripts/server/subaccount.js index 3f680d24..920bfc10 100644 --- a/scripts/server/subaccount.js +++ b/scripts/server/subaccount.js @@ -353,6 +353,8 @@ function selectCharacter(client, characterId = -1) { onPlayerSpawn(client); }, 1000); + playRadioStreamForPlayer(client, ""); + getPlayerCurrentSubAccount(client).lastLogin = getCurrentUnixTimestamp(); } @@ -381,6 +383,8 @@ function switchCharacterCommand(command, params, client) { logToConsole(client, `Saving ${getPlayerDisplayForConsole(client)}'s subaccount (${getCharacterFullName(client)} [${getPlayerData(client).currentSubAccount}/${getPlayerCurrentSubAccount(client).databaseId}] to database`) saveSubAccountToDatabase(getPlayerCurrentSubAccount(client)); + disableCityAmbienceForPlayer(client); + resetClientStuff(client); client.despawnPlayer(); @@ -473,6 +477,10 @@ function getPlayerCurrentSubAccount(client) { return false; } + if(typeof getPlayerData(client).subAccounts[subAccountId] == "undefined") { + return false; + } + return getPlayerData(client).subAccounts[subAccountId]; }