SetRadioChannel: Difference between revisions
Jump to navigation
Jump to search
Paul Cortez (talk | contribs) m (Believe it or not, this DOES work outside of a vehicle) |
|||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
This function sets the currently active radio channel. | This function sets the currently active radio channel. | ||
This | This function also works while not in a vehicle. | ||
==Syntax== | ==Syntax== |
Revision as of 13:51, 26 February 2010
This function sets the currently active radio channel.
This function also works while not in a vehicle.
Syntax
bool setRadioChannel ( int ID )
Required Arguments
- ID: The ID of the radio station you want to play.
- 0: Radio Off
- 1: Playback FM
- 2: K-Rose
- 3: K-DST
- 4: Bounce FM
- 5: SF-UR
- 6: Radio Los Santos
- 7: Radio X
- 8: CSR 103.9
- 9: K-Jah West
- 10: Master Sounds 98.3
- 11: WCTR
- 12: User Track Player
Returns
Returns true if channel was set successfully, false otherwise.
Example
This example adds a command setradio which can be used to change the current radio station by ID.
Click to collapse [-]
ClientaddCommandHandler ( "setradio", function ( command, stationID ) local result = setRadioChannel ( tonumber( stationID ) ) if result then -- if we had a valid ID outputChatBox ( "Changed your radio station to " .. getRadioChannelName ( tonumber ( stationID ) ) .. "!" ) else outputChatBox ( "Invalid radio station ID, valid ones are 0-13." ) end end )
See Also
- getRadioChannel
- getRadioChannelName
- getSFXStatus
- getSoundBPM
- getSoundBufferLength
- getSoundEffectParameters
- getSoundEffects
- getSoundFFTData
- getSoundLength
- getSoundLevelData
- getSoundMaxDistance
- getSoundMetaTags
- getSoundMinDistance
- getSoundPan
- getSoundPosition
- getSoundProperties
- getSoundSpeed
- getSoundVolume
- getSoundWaveData
- isSoundLooped
- isSoundPanningEnabled
- isSoundPaused
- playSFX3D
- playSFX
- playSound3D
- playSound
- setRadioChannel
- setSoundEffectEnabled
- setSoundEffectParameter
- setSoundLooped
- setSoundMaxDistance
- setSoundMinDistance
- setSoundPan
- setSoundPanningEnabled
- setSoundPaused
- setSoundPosition
- setSoundProperties
- setSoundSpeed
- setSoundVolume
- stopSound
- Shared
- playSoundFrontEnd