AR/setRadioChannel: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(setRadioChannel)
 
mNo edit summary
 
(4 intermediate revisions by one other user not shown)
Line 11: Line 11:


===Required Arguments===  
===Required Arguments===  
*'''ID:''' The ID of the radio station you want to play.
*'''ID:''' .ايدي الراديو الذي تريد تشغيله


{{SoundID}}
{{SoundID}}


===Returns===
===Returns===
Returns ''true'' if channel was set successfully, ''false'' otherwise.
"true" اذا تم تعين محطة راديو بنجاح
"false" اذا لم يتم تعين محطة راديو


==Example==
==مثال==
This example adds a command ''setradio'' which can be used to change the current radio station by ID.
هذا المثال يقوم بأضافة امر "setradio " لتغير قناة الراديو الحالية عبر الايدي
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addCommandHandler ( "setradio",
addCommandHandler ( "setradio", -- "setradio" اضافة امر
     function ( command, stationID )
     function ( command, stationID ) -- تعريف
         local result = setRadioChannel ( tonumber( stationID ) )
         local result = 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 ) ) .. "!" ) -- اضهار نص في الشات
         else
         else
             outputChatBox ( "Invalid radio station ID, valid ones are 0-12." )
             outputChatBox ( "Invalid radio station ID, valid ones are 0-12." ) -- اضهار نص في الشات
         end
         end
     end
     end  
)
)
</syntaxhighlight>
</syntaxhighlight>
Line 38: Line 39:


{{AR/Audio_functions}}
{{AR/Audio_functions}}
[[PT-BR:setRadioChannel]]

Latest revision as of 23:14, 18 August 2021

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

"true" اذا تم تعين محطة راديو بنجاح "false" اذا لم يتم تعين محطة راديو

مثال

هذا المثال يقوم بأضافة امر "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 
)

أنظر أيضاً