AR/setRadioChannel

From Multi Theft Auto: Wiki
Revision as of 09:51, 7 February 2016 by Strong100 (talk | contribs) (→‎Example)
Jump to navigation Jump to search

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: .ايدي الراديو الذي تريد تشغيله
  • 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

هذا المثال يقوم بأضافة امر "setradio " لتغير قناة الراديو الحالية عبر الايدي

Click to collapse [-]
Client
addCommandHandler ( "setradio", -- "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-12." ) -- اضهار نص في الشات
        end
    end 
)

أنظر أيضاً