Audio::freezeRadioStation: Difference between revisions
(yay) |
No edit summary |
||
| (2 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{ClientsideJsFunction}} | |||
{{JSContainer| | |||
The `freezeRadioStation` function allows you to lock a specified radio station to keep it playing even if the player changes vehicles. This can be helpful for scripted scenarios where you want to control the in-game music experience consistently. | |||
=== Required | === Required Params === | ||
*'''radioStation:''' String | * '''radioStation:''' {{RageType|String}} – The name of the radio station to freeze. | ||
===Return | |||
*'''Undefined''' | === Return Value === | ||
== | * '''Undefined''' – This function does not return a value. | ||
== Syntax == | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
mp.game.audio.freezeRadioStation(radioStation); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See | |||
{{ | == Example == | ||
<syntaxhighlight lang="javascript"> | |||
// Example usage of freezeRadioStation | |||
const radioStation = "RADIO_01_CLASS_ROCK"; // Set to the Classic Rock station | |||
mp.game.audio.freezeRadioStation(radioStation); // Freeze the station to keep playing | |||
mp.gui.chat.push("Radio station frozen: " + radioStation); | |||
</syntaxhighlight> | |||
== Available Radio Stations == | |||
Here are some of the available radio stations in GTA V: | |||
* '''RADIO_01_CLASS_ROCK''' – Los Santos Rock Radio | |||
* '''RADIO_02_POP''' – Non-Stop-Pop FM | |||
* '''RADIO_03_HIPHOP_NEW''' – Radio Los Santos | |||
* '''RADIO_04_PUNK''' – Channel X | |||
* '''RADIO_05_TALK_01''' – West Coast Talk Radio | |||
* '''RADIO_06_COUNTRY''' – Rebel Radio | |||
* '''RADIO_07_DANCE''' – Soulwax FM | |||
* '''RADIO_08_MEXICAN''' – East Los FM | |||
* '''RADIO_09_HIPHOP_OLD''' – West Coast Classics | |||
* '''RADIO_12_REGGAE''' – Blue Ark | |||
* '''RADIO_13_JAZZ''' – Worldwide FM | |||
* '''RADIO_14_DANCE_02''' – FlyLo FM | |||
* '''RADIO_15_MOTOWN''' – The Lowdown 91.1 | |||
* '''RADIO_16_SILVERLAKE''' – Radio Mirror Park | |||
* '''RADIO_17_FUNK''' – Space 103.2 | |||
== See Also == | |||
{{Audio_s_function_c}} | |||
[[Category:Clientside API]] | [[Category:Clientside API]] | ||
[[Category: | [[Category:Audio API]] | ||
}} | |||
Latest revision as of 10:51, 2 November 2024
Client-Side Function
JavaScript Syntax
The `freezeRadioStation` function allows you to lock a specified radio station to keep it playing even if the player changes vehicles. This can be helpful for scripted scenarios where you want to control the in-game music experience consistently.
Required Params
- radioStation: String – The name of the radio station to freeze.
Return Value
- Undefined – This function does not return a value.
Syntax
mp.game.audio.freezeRadioStation(radioStation);
Example
// Example usage of freezeRadioStation
const radioStation = "RADIO_01_CLASS_ROCK"; // Set to the Classic Rock station
mp.game.audio.freezeRadioStation(radioStation); // Freeze the station to keep playing
mp.gui.chat.push("Radio station frozen: " + radioStation);
Available Radio Stations
Here are some of the available radio stations in GTA V:
- RADIO_01_CLASS_ROCK – Los Santos Rock Radio
- RADIO_02_POP – Non-Stop-Pop FM
- RADIO_03_HIPHOP_NEW – Radio Los Santos
- RADIO_04_PUNK – Channel X
- RADIO_05_TALK_01 – West Coast Talk Radio
- RADIO_06_COUNTRY – Rebel Radio
- RADIO_07_DANCE – Soulwax FM
- RADIO_08_MEXICAN – East Los FM
- RADIO_09_HIPHOP_OLD – West Coast Classics
- RADIO_12_REGGAE – Blue Ark
- RADIO_13_JAZZ – Worldwide FM
- RADIO_14_DANCE_02 – FlyLo FM
- RADIO_15_MOTOWN – The Lowdown 91.1
- RADIO_16_SILVERLAKE – Radio Mirror Park
- RADIO_17_FUNK – Space 103.2
See Also
- mp.game.audio.playPedRingtone
- mp.game.audio.isPedRingtonePlaying
- mp.game.audio.stopPedRingtone
- mp.game.audio.isMobilePhoneCallOngoing
- mp.game.audio.createNewScriptedConversation
- mp.game.audio.addLineToConversation
- mp.game.audio.addPedToConversation
- mp.game.audio.setMicrophonePosition
- mp.game.audio.startScriptPhoneConversation
- mp.game.audio.preloadScriptPhoneConversation
- mp.game.audio.startScriptConversation
- mp.game.audio.preloadScriptConversation
- mp.game.audio.startPreloadedConversation
- mp.game.audio.getIsPreloadedConversationReady
- mp.game.audio.isScriptedConversationOngoing
- mp.game.audio.isScriptedConversationLoaded
- mp.game.audio.getCurrentScriptedConversationLine
- mp.game.audio.pauseScriptedConversation
- mp.game.audio.restartScriptedConversation
- mp.game.audio.stopScriptedConversation
- mp.game.audio.skipToNextScriptedConversationLine
- mp.game.audio.interruptConversation
- mp.game.audio.interruptConversationAndPause
- mp.game.audio.registerScriptWith
- mp.game.audio.registerScriptWithAudio
- mp.game.audio.unregisterScriptWith
- mp.game.audio.requestMissionBank
- mp.game.audio.requestMissionAudioBank
- mp.game.audio.requestAmbientBank
- mp.game.audio.requestAmbientAudioBank
- mp.game.audio.requestScriptBank
- mp.game.audio.requestScriptAudioBank
- mp.game.audio.hintAmbientBank
- mp.game.audio.hintAmbientAudioBank
- mp.game.audio.hintScriptBank
- mp.game.audio.hintScriptAudioBank
- mp.game.audio.releaseMissionBank
- mp.game.audio.releaseAmbientBank
- mp.game.audio.releaseNamedScriptBank
- mp.game.audio.releaseNamedScriptAudioBank
- mp.game.audio.releaseScriptBank
- mp.game.audio.getSoundId
- mp.game.audio.releaseSoundId
- mp.game.audio.playSound
- mp.game.audio.playSoundFrontend
- mp.game.audio.playDeferredSoundFrontend
- mp.game.audio.playSoundFromEntity
- mp.game.audio.playSoundFromCoord
- mp.game.audio.stopSound
- mp.game.audio.getNetworkIdFromSoundId
- mp.game.audio.getSoundIdFromNetworkId
- mp.game.audio.setVariableOnSound
- mp.game.audio.setVariableOnStream
- mp.game.audio.overrideUnderwaterStream
- mp.game.audio.setVariableOnUnderWaterStream
- mp.game.audio.hasSoundFinished
- mp.game.audio.playPedAmbientSpeechNative
- mp.game.audio.playPedAmbientSpeechAndCloneNative
- mp.game.audio.playPedAmbientSpeechWithVoiceNative
- mp.game.audio.playAmbientSpeechWithVoice
- mp.game.audio.playAmbientSpeechFromPositionNative
- mp.game.audio.playAmbientSpeechAtCoords
- mp.game.audio.overrideTrevorRage
- mp.game.audio.resetTrevorRage
- mp.game.audio.setPlayerAngry
- mp.game.audio.playPain
- mp.game.audio.releaseWeapon
- mp.game.audio.activateSlowmoMode
- mp.game.audio.deactivateSlowmoMode
- mp.game.audio.setAmbientVoiceName
- mp.game.audio.setAmbientVoiceNameHash
- mp.game.audio.getAmbientVoiceNameHash
- mp.game.audio.setPedScream
- mp.game.audio.setPedVoiceGroup
- mp.game.audio.setPedGender
- mp.game.audio.stopCurrentPlayingSpeech
- mp.game.audio.stopCurrentPlayingAmbientSpeech
- mp.game.audio.isAmbientSpeechPlaying
- mp.game.audio.isScriptedSpeechPlaying
- mp.game.audio.isAnySpeechPlaying
- mp.game.audio.canPedSpeak
- mp.game.audio.isPedInCurrentConversation
- mp.game.audio.setPedIsDrunk
- mp.game.audio.playAnimalVocalization
- mp.game.audio.isAnimalVocalizationPlaying
- mp.game.audio.setAnimalMood
- mp.game.audio.isMobilePhoneRadioActive
- mp.game.audio.setMobilePhoneRadioState
- mp.game.audio.getPlayerRadioStationIndex
- mp.game.audio.getPlayerRadioStationName
- mp.game.audio.getRadioStationName
- mp.game.audio.getPlayerRadioStationGenre
- mp.game.audio.isRadioRetuning
- mp.game.audio.isRadioFadedOut
- mp.game.audio.setRadioToStationName
- mp.game.audio.setVehRadioStation
- mp.game.audio.setVehHasRadioOverride
- mp.game.audio.isVehicleRadioEnabled
- mp.game.audio.setEmitterRadioStation
- mp.game.audio.setStaticEmitterEnabled
- mp.game.audio.linkStaticEmitterToEntity
- mp.game.audio.setRadioToStationIndex
- mp.game.audio.setFrontendRadioActive
- mp.game.audio.unlockMissionNewsStory
- mp.game.audio.isMissionNewsStoryUnlocked
- mp.game.audio.getNumberOfPassengerVoiceVariations
- mp.game.audio.getAudibleMusicTrackTextId
- mp.game.audio.playEndCreditsMusic
- mp.game.audio.skipRadioForward
- mp.game.audio.freezeRadioStation
- mp.game.audio.unfreezeRadioStation
- mp.game.audio.setRadioAutoUnfreeze
- mp.game.audio.setInitialPlayerStation
- mp.game.audio.setUserRadioControlEnabled
- mp.game.audio.setRadioTrack
- mp.game.audio.setRadioTrackMix
- mp.game.audio.setVehicleRadioLoud
- mp.game.audio.isVehicleRadioLoud
- mp.game.audio.setMobileRadioEnabledDuringGameplay
- mp.game.audio.doesPlayerVehHaveRadio
- mp.game.audio.isPlayerVehRadioEnable
- mp.game.audio.setVehicleRadioEnabled
- mp.game.audio.setCustomRadioTrackList
- mp.game.audio.clearCustomRadioTrackList
- mp.game.audio.getNumUnlockedRadioStations
- mp.game.audio.findRadioStationIndex
- mp.game.audio.setRadioStationMusicOnly
- mp.game.audio.setRadioFrontendFadeTime
- mp.game.audio.unlockRadioStationTrackList
- mp.game.audio.lockRadioStationTrackList
- mp.game.audio.updateLsur
- mp.game.audio.lockRadioStation
- mp.game.audio.setRadioStationIsVisible
- mp.game.audio.forceRadioTrackListPosition
- mp.game.audio.getCurrentRadioStationHash
- mp.game.audio.setAmbientZoneState
- mp.game.audio.clearAmbientZoneState
- mp.game.audio.setAmbientZoneListState
- mp.game.audio.clearAmbientZoneListState
- mp.game.audio.setAmbientZoneStatePersistent
- mp.game.audio.setAmbientZoneListStatePersistent
- mp.game.audio.isAmbientZoneEnabled
- mp.game.audio.setCutsceneOverride
- mp.game.audio.setCutsceneAudioOverride
- mp.game.audio.setVariableOnCutscene
- mp.game.audio.getPlayerHeadsetSoundAlternate
- mp.game.audio.playPoliceReport
- mp.game.audio.cancelCurrentPoliceReport
- mp.game.audio.blipSiren
- mp.game.audio.overrideVehHorn
- mp.game.audio.isHornActive
- mp.game.audio.setAggressiveHorns
- mp.game.audio.isStreamPlaying
- mp.game.audio.getStreamPlayTime
- mp.game.audio.loadStream
- mp.game.audio.loadStreamWithStartOffset
- mp.game.audio.playStreamFromPed
- mp.game.audio.playStreamFromVehicle
- mp.game.audio.playStreamFromObject
- mp.game.audio.playStreamFrontend
- mp.game.audio.playStreamFromPosition
- mp.game.audio.specialFrontendEqual
- mp.game.audio.stopStream
- mp.game.audio.stopPedSpeaking
- mp.game.audio.disablePedPain
- mp.game.audio.isAmbientSpeechDisabled
- mp.game.audio.setSirenWithNoDriver
- mp.game.audio.setSirenKeepOn
- mp.game.audio.triggerSiren
- mp.game.audio.setHornPermanentlyOn
- mp.game.audio.setHornEnabled
- mp.game.audio.setVehiclePriority
- mp.game.audio.setHornPermanentlyOnTime
- mp.game.audio.useSirenAsHorn
- mp.game.audio.forceVehicleEngine
- mp.game.audio.preloadVehicle
- mp.game.audio.setVehicleStartupRevSound
- mp.game.audio.resetVehicleStartupRevSound
- mp.game.audio.isVehicleAudiblyDamaged
- mp.game.audio.setVehicleEngineDamageFactor
- mp.game.audio.setVehicleBodyDamageFactor
- mp.game.audio.enableVehicleFanbeltDamage
- mp.game.audio.enableVehicleExhaustPops
- mp.game.audio.setVehicleBoostActive
- mp.game.audio.setScriptUpdateDoor
- mp.game.audio.playVehicleDoorOpenSound
- mp.game.audio.playVehicleDoorCloseSound
- mp.game.audio.enableStallWarningSounds
- mp.game.audio.isGameInControlOfMusic
- mp.game.audio.setGpsActive
- mp.game.audio.playMissionComplete
- mp.game.audio.playMissionCompleteAudio
- mp.game.audio.isMissionCompletePlaying
- mp.game.audio.isMissionCompleteReadyForUi
- mp.game.audio.blockDeathJingle
- mp.game.audio.startScene
- mp.game.audio.startAudioScene
- mp.game.audio.stopScene
- mp.game.audio.stopAudioScene
- mp.game.audio.stopScenes
- mp.game.audio.isSceneActive
- mp.game.audio.isAudioSceneActive
- mp.game.audio.setSceneVariable
- mp.game.audio.setAudioSceneVariable
- mp.game.audio.setScriptCleanupTime
- mp.game.audio.addEntityToMixGroup
- mp.game.audio.removeEntityFromMixGroup
- mp.game.audio.isScriptedMusicPlaying
- mp.game.audio.isScriptedMusicPlaying2
- mp.game.audio.prepareMusicEvent
- mp.game.audio.cancelMusicEvent
- mp.game.audio.triggerMusicEvent
- mp.game.audio.isMusicOneshotPlaying
- mp.game.audio.getMusicPlaytime
- mp.game.audio.recordBrokenGlass
- mp.game.audio.clearAllBrokenGlass
- mp.game.audio.forcePedPanicWalla
- mp.game.audio.prepareAlarm
- mp.game.audio.startAlarm
- mp.game.audio.stopAlarm
- mp.game.audio.stopAllAlarms
- mp.game.audio.isAlarmPlaying
- mp.game.audio.getVehicleDefaultHorn
- mp.game.audio.getVehicleDefaultHornIgnoreMods
- mp.game.audio.resetPedFlags
- mp.game.audio.resetPedAudioFlags
- mp.game.audio.setPedFootstepLoud
- mp.game.audio.setPedFootstepQuiet
- mp.game.audio.overridePlayerGroundMaterial
- mp.game.audio.overrideMicrophoneSettings
- mp.game.audio.freezeMicrophone
- mp.game.audio.distantCopCarSirens
- mp.game.audio.setFlag
- mp.game.audio.setAudioFlag
- mp.game.audio.prepareSynchronizedEvent
- mp.game.audio.prepareSynchronizedAudioEvent
- mp.game.audio.prepareSynchronizedEventForScene
- mp.game.audio.prepareSynchronizedAudioEventForScene
- mp.game.audio.playSynchronizedEvent
- mp.game.audio.playSynchronizedAudioEvent
- mp.game.audio.stopSynchronizedEvent
- mp.game.audio.stopSynchronizedAudioEvent
- mp.game.audio.setSynchronizedEventPositionThisFrame
- mp.game.audio.setSynchronizedAudioEventPositionThisFrame
- mp.game.audio.setSpecialEffectMode
- mp.game.audio.setPortalSettingsOverride
- mp.game.audio.removePortalSettingsOverride
- mp.game.audio.getMusicVolSlider
- mp.game.audio.requestTennisBanks
- mp.game.audio.unrequestTennisBanks
- mp.game.audio.stopCutscene
- mp.game.audio.hasMultiplayerDataLoaded
- mp.game.audio.hasMultiplayerDataUnloaded
- mp.game.audio.getVehicleDefaultHornVariation
- mp.game.audio.setVehicleHornVariation
- mp.game.audio.restoreCategoryVariables
- mp.game.audio.getCategoryVariable
- mp.game.audio.setCategoryVariable
- mp.game.audio.copyCategoryVariables
- mp.game.audio.playSoundHash