From 2a24ef7b478a8b794ad2ea00b3464b2a2ba006da Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Wed, 11 Aug 2021 09:42:23 -0500 Subject: [PATCH] Add util to stop radio stream --- scripts/server/client.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/server/client.js b/scripts/server/client.js index 27c7137d..f1daf516 100644 --- a/scripts/server/client.js +++ b/scripts/server/client.js @@ -906,6 +906,13 @@ function playRadioStreamForPlayer(client, streamURL, loop = true, volume = 0, el // =========================================================================== +function stopRadioStreamForPlayer(client) { + logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stop their radio stream`); + triggerNetworkEvent("vrr.stopRadioStream", client); +} + +// =========================================================================== + function setPlayerStreamingRadioVolume(client, volumeLevel, elementId = false) { getPlayerData(client).accountData.streamingRadioVolume = volumeLevel; getPlayerData(client).streamingRadioElement = elementId; @@ -934,6 +941,14 @@ function makePedPlayAnimation(ped, animationSlot) { // =========================================================================== +function forcePedAnimation(ped, animationSlot) { + let animationData = getAnimationData(animationSlot); + + triggerNetworkEvent("vrr.forcePedAnim", null, ped.id, animationData[1], animationData[2], animationData[3], animationData[4]); +} + +// =========================================================================== + function hideAllPlayerGUI(client) { triggerNetworkEvent("vrr.hideAllGUI", client); }