AR/getSoundPosition: Difference between revisions
Jump to navigation
Jump to search
The-Killer (talk | contribs) No edit summary |
The-Killer (talk | contribs) |
||
Line 17: | Line 17: | ||
تشغيل الصوت ثم معرفة مكان الصوت | تشغيل الصوت ثم معرفة مكان الصوت | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
local sound = playSound("randomSound.mp3",false) --تشغيل الصوت | addCommandHandler("start", -- الامر لتشغيل الصوت | ||
function () | |||
local sound = playSound("randomSound.mp3",false)-- تشغيل الصوت | |||
end | |||
) | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="lua"> | |||
addCommandHandler("position",-- امر لأحضار مكان الصوت | |||
function () | |||
local soundPosition = getSoundPosition(sound) -- احضار مكا ن الصوت | local soundPosition = getSoundPosition(sound) -- احضار مكا ن الصوت | ||
outputChatBox("مكان الصوت هو: " .. soundPosition .. ".") | outputChatBox("مكان الصوت هو: " .. soundPosition .. ".")-- يظهر في الشات | ||
end | |||
) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 17:55, 3 January 2014
هذه الداله يتم استخدامها لأحضار مكان الصوت. اذا كن العنصر لاعب, هذه الداله ستستخدم صوت الاعب.
Syntax
float getSoundPosition ( element theSound )
Required Arguments
- theSound: اسم الصوت الذي تريد معرفة مكانه.
Returns
ارجاع القيمه float مما يدل على مكان العنصر sound في ثواني.
Example
تشغيل الصوت ثم معرفة مكان الصوت
addCommandHandler("start", -- الامر لتشغيل الصوت function () local sound = playSound("randomSound.mp3",false)-- تشغيل الصوت end )
addCommandHandler("position",-- امر لأحضار مكان الصوت function () local soundPosition = getSoundPosition(sound) -- احضار مكا ن الصوت outputChatBox("مكان الصوت هو: " .. soundPosition .. ".")-- يظهر في الشات end )
Changelog
Version | Description |
---|
1.3.2 | اضافة عنصر الاعب لأستخدام صوت الاعب |
By The Killer.
أنظر أيضاً
- getSoundBufferLength
- getSoundEffects
- getSoundFFTData
- getSoundLength
- getSoundLevelData
- getSoundMaxDistance