AR/getRadioChannel: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
 
(21 intermediate revisions by 6 users not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}
{{Client function}}
This function retrieves the ID of the currently active radio channel.
. تجلب هذة الوظيفة اي دي قناة الراديو 


==Syntax==  
==تركيب الوظيفة==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
int getRadioChannel ( )             
int getRadioChannel ( )             
</syntaxhighlight>  
</syntaxhighlight>  


===Returns===
===المعطيات===
Returns the ID of the radio channel.
. تعطي الاي دي لقناة الراديو
{{SoundID}}
{{SoundID}}


==مثال==
==مثال==
. هذا المثال يطبع اسم محطة الراديو الحالية للشات   
. هذا المثال يكتب اسم قناة الراديو الحالية في الدردشة   
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addCommandHandler ( "getradio",  
addCommandHandler ( "getradio", -- اضافة امر 
     function ()
     function () -- بداية الوظيفة
         outputChatBox ( "You're currently listening to " .. getRadioChannelName ( getRadioChannel() ) .. "!" )
         outputChatBox ( "انت الان تستمع ل " .. getRadioChannelName ( getRadioChannel() ) .. "!" ) -- اخراج رسالة فى الدردشة بأسم قناة الراديو الحالية
     end
     end --  نهاية الوظيفة
)
) -- نهاية الامر
</syntaxhighlight>
</section>
 
==مثال 2==
. هذا المثال يكتب قناة الراديو الحالية عندما يدخل الاعب الى مركبة
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
addEventHandler("onClientPlayerVehicleEnter",getLocalPlayer(), -- اضافة حدث عندما يدخل الاعب الى مركبة
function() -- بداية الوظيفة
local RadioID = getRadioChannel() -- الحصول على اي دي محطة الراديو
local RadioChannelName = getRadioChannelName ( RadioID ) -- الحصول على اسم قناة الراديو الحالية
outputChatBox("قناة الراديو الحالية  "..RadioChannelName) -- اخراج رسالة فى الدردشة بأسم قناة الراديو الحالية
end -- نهاية الوظيفة
)-- نهاية الحدث
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>
Line 27: Line 41:


{{AR/Audio_functions}}
{{AR/Audio_functions}}
[[EN:GetRadioChannel]]
[[HU:GetRadioChannel]]
[[DE:getRadioChannel]]
[[RU:GetRadioChannel]]
[[PL:GetRadioChannel]]
[[RO:GetRadioChannel]]
[[PT-BR:GetRadioChannel]]

Latest revision as of 15:11, 11 June 2023

. تجلب هذة الوظيفة اي دي قناة الراديو   

تركيب الوظيفة

int getRadioChannel ( )             

المعطيات

. تعطي الاي دي لقناة الراديو

  • 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

مثال

. هذا المثال يكتب اسم قناة الراديو الحالية في الدردشة

Click to collapse [-]
Client
addCommandHandler ( "getradio",  -- اضافة امر  
    function () -- بداية الوظيفة
        outputChatBox ( "انت الان تستمع ل " .. getRadioChannelName ( getRadioChannel() ) .. "!" ) -- اخراج رسالة فى الدردشة بأسم قناة الراديو الحالية
    end --  نهاية الوظيفة
) -- نهاية الامر

مثال 2

. هذا المثال يكتب قناة الراديو الحالية عندما يدخل الاعب الى مركبة

Click to collapse [-]
Client
addEventHandler("onClientPlayerVehicleEnter",getLocalPlayer(), -- اضافة حدث عندما يدخل الاعب الى مركبة
function() -- بداية الوظيفة
local RadioID = getRadioChannel() -- الحصول على اي دي محطة الراديو
local RadioChannelName = getRadioChannelName ( RadioID ) -- الحصول على اسم قناة الراديو الحالية
outputChatBox("قناة الراديو الحالية  "..RadioChannelName) -- اخراج رسالة فى الدردشة بأسم قناة الراديو الحالية
end -- نهاية الوظيفة
)-- نهاية الحدث

أنظر أيضاً