HU/setRadioChannel: Difference between revisions
Jump to navigation
Jump to search
(→Példa) |
(→Példa) |
||
Line 23: | Line 23: | ||
addCommandHandler ( "setradio", | addCommandHandler ( "setradio", | ||
function ( command, stationID ) | function ( command, stationID ) | ||
local result = | local result = [hu:setRadioChannel] ( tonumber( stationID ) ) | ||
if result then -- if we had a valid ID | if result then -- if we had a valid ID | ||
outputChatBox ( "Changed your radio station to " .. getRadioChannelName ( tonumber ( stationID ) ) .. "!" ) | outputChatBox ( "Changed your radio station to " .. getRadioChannelName ( tonumber ( stationID ) ) .. "!" ) |
Revision as of 19:22, 21 July 2018
Ez a funkció a rádiócsatornát állítja be, még akkor is, ha nincs a járműben.
Szintaxis
bool setRadioChannel ( int ID )
Kötelező Argumentumo
- ID: A lejátszani kívánt rádióállomás ID-je.
- 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
Visszaadott érték
Returns true if channel was set successfully, false otherwise.
Példa
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 = [hu: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-12." ) end end )
Issues
Issue ID | Description |
---|---|
#8908 | setRadioChannel sometimes doesn't work when outside a vehicle |
Lásd még
- HU/getRadioChannel
- HU/getRadioChannelName
- HU/getSFXStatus
- HU/getSoundBPM
- HU/getSoundEffects
- HU/getSoundFFTData
- HU/getSoundLength
- HU/getSoundLevelData
- HU/getSoundMaxDistance
- HU/getSoundMetaTags
- HU/getSoundMinDistance
- HU/getSoundPan
- HU/getSoundPosition
- HU/getSoundProperties
- HU/getSoundSpeed
- HU/getSoundVolume
- HU/getSoundWaveData
- HU/isSoundPanningEnabled
- HU/isSoundPaused
- HU/playSFX
- HU/playSFX3D
- HU/playSound
- HU/playSound3D
- HU/playSoundFrontEnd
- HU/setRadioChannel
- HU/setSoundEffectEnabled
- HU/setSoundMaxDistance
- HU/setSoundMinDistance
- HU/setSoundPan
- HU/setSoundPanningEnabled
- HU/setSoundPaused
- HU/setSoundPosition
- HU/setSoundProperties
- HU/setSoundSpeed
- HU/setSoundVolume
- HU/stopSound
Fordította
Surge