AR/setSoundPaused: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(setSoundPaused)
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}
{{Client function}}
This function is used to either pause or unpause the playback of the specified [[sound]] element.
مؤقت ( [[sound]] ) تستخدم هذه الدالة لأيقاف او الغاء ايقاف العنصر
 
{{New_feature|3.0139|1.3.2|
{{New_feature|3.0139|1.3.2|
Use a player element to control a players voice with this function.
( يمكن استخدام هاذه الوضيفة لللآعبين ( اسكات الاعب
}}
}}
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">bool setSoundPaused ( element theSound, bool paused )</syntaxhighlight>  
<syntaxhighlight lang="lua">bool setSoundPaused ( element theSound, bool paused )</syntaxhighlight>  


===Required Arguments===  
===العناصر المطلوبة===  
*'''theSound:''' The [[sound]] element which you want to pause/unpause.
*'''theSound:''' . المراد ايقافه او الغاء ايقافه مؤقت [[sound]] الصوت
*'''paused:''' A [[boolean]] value representing whether the sound should be paused or not. To pause the sound, use ''true''.
*'''paused:''' [[boolean]] الحالة المطلوبة ايقاف \ الغاء الأيقاف


===Returns===
===Returns===
Returns ''true'' if the [[sound]] element was successfully paused, ''false'' otherwise.
*'''Returns:''' ''true'' [[sound]] اذا نجحت الوضيفة في الأيقاف او الغاء ايقاف الصوت, ''false'' لم تنجح.


==Example==  
==Example==  
This example will allow the user to toggle sounds from paused to playing, and from playing to paused
هذه المثال سيكون فيه ايقاف و الغاء الأيقاف المؤقت
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
theSound = playSound("music/song.mp3", true)
theSound = playSound("music/song.mp3", true) -- الصوت
function togglePausedSound()
function togglePausedSound() -- وضيفة
     if(isSoundPaused(theSound)) then --sound is paused, un-pause it
     if(isSoundPaused(theSound)) then -- اذا كان متوقف مؤقتاً
         setSoundPaused(theSound, false)
         setSoundPaused(theSound, false) -- تشغيل الصوت
     else --sound is not paused, pause it
     else -- اذا لم يكن متوقف
         setSoundPaused(theSound, true)
         setSoundPaused(theSound, true) -- ايقاف الصوت
     end
     end -- اغلآق الشرط
end
end -- اغلاق الوضيفة
addCommandHandler("pausesound", togglePausedSound)
addCommandHandler("pausesound", togglePausedSound) -- امر الأيقاف او الغاء الأيقاف
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>


==Changelog==
==التحديث==
{{ChangelogHeader}}
{{ChangelogHeader}}
{{ChangelogItem|1.3.2|Added player element for voice control}}
{{ChangelogItem|1.3.2|يمكن التحكم باصوات اللآعبين ايقاف \ الغاء الأيقاف}}


==أنظر أيضاً==
==أنظر أيضاً==
{{AR/Audio_functions}}
{{AR/Audio_functions}}

Latest revision as of 21:03, 8 May 2013

مؤقت ( sound ) تستخدم هذه الدالة لأيقاف او الغاء ايقاف العنصر

( يمكن استخدام هاذه الوضيفة لللآعبين ( اسكات الاعب

Syntax

bool setSoundPaused ( element theSound, bool paused )

العناصر المطلوبة

  • theSound: . المراد ايقافه او الغاء ايقافه مؤقت sound الصوت
  • paused: boolean الحالة المطلوبة ايقاف \ الغاء الأيقاف

Returns

  • Returns: true sound اذا نجحت الوضيفة في الأيقاف او الغاء ايقاف الصوت, false لم تنجح.

Example

هذه المثال سيكون فيه ايقاف و الغاء الأيقاف المؤقت

Click to collapse [-]
Client
theSound = playSound("music/song.mp3", true) -- الصوت
function togglePausedSound() -- وضيفة
    if(isSoundPaused(theSound)) then -- اذا كان متوقف مؤقتاً
        setSoundPaused(theSound, false) -- تشغيل الصوت
    else -- اذا لم يكن متوقف
        setSoundPaused(theSound, true) -- ايقاف الصوت
    end -- اغلآق الشرط
end -- اغلاق الوضيفة
addCommandHandler("pausesound", togglePausedSound) -- امر الأيقاف او الغاء الأيقاف

التحديث

Version Description
1.3.2 يمكن التحكم باصوات اللآعبين ايقاف \ الغاء الأيقاف

أنظر أيضاً