From c8992ce2de77c0e81e0a36f625bd2096c0c3c479 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Fri, 17 Jun 2022 08:03:31 -0500 Subject: [PATCH] Check if player int and vw are in main world before radio --- scripts/server/event.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/scripts/server/event.js b/scripts/server/event.js index 65b94cfd..b9e9a95e 100644 --- a/scripts/server/event.js +++ b/scripts/server/event.js @@ -654,15 +654,17 @@ async function onPlayerSpawn(client) { stopRadioStreamForPlayer(client); // Start playing business/house radio if in one - let businessId = getPlayerBusiness(client); - let houseId = getPlayerHouse(client); - if (businessId != -1) { - if (getBusinessData(businessId).streamingRadioStation != -1) { - playRadioStreamForPlayer(client, getRadioStationData(getBusinessData(businessId).streamingRadioStation).url, true, getPlayerStreamingRadioVolume(client), null); - } - } else if (houseId != -1) { - if (getHouseData(houseId).streamingRadioStation != -1) { - playRadioStreamForPlayer(client, getRadioStationData(getHouseData(houseId).streamingRadioStation).url, true, getPlayerStreamingRadioVolume(client), null); + if (getPlayerCurrentSubAccount(client).interior != getGameConfig().mainWorldInterior || getPlayerCurrentSubAccount(client).dimension != getGameConfig().mainWorldDimension) { + let businessId = getPlayerBusiness(client); + let houseId = getPlayerHouse(client); + if (businessId != -1) { + if (getBusinessData(businessId).streamingRadioStation != -1) { + playRadioStreamForPlayer(client, getRadioStationData(getBusinessData(businessId).streamingRadioStation).url, true, getPlayerStreamingRadioVolume(client), null); + } + } else if (houseId != -1) { + if (getHouseData(houseId).streamingRadioStation != -1) { + playRadioStreamForPlayer(client, getRadioStationData(getHouseData(houseId).streamingRadioStation).url, true, getPlayerStreamingRadioVolume(client), null); + } } }