Jump to content

playSound , getSoundLenth


Recommended Posts

Posted

سلام عليكم

ابي اشغل صوت من السيرفر عن طريق رابط 

ويشغل الصوت ويكتبلي بالشات حجم الصوت كام 

يعني كام ثانية الصوت

هادي تطلع الصوت 0

sound = playSound3D(link, -1233.9285888672, 456.3063659668, 6.4603748321533, true) 
length_s = getSoundLength(sound)
outputChatBox(length_s,255,0,0,true)

 

330xum0.jpg

p_862d3zvf1.png

* تم آلآفتتآح مرة اخري , حياكم الله *

ip : * mtasa://145.239.212.62:22003 *

330xum0.jpg

Posted
2 hours ago, Mr.Mostafa said:

سلام عليكم

ابي اشغل صوت من السيرفر عن طريق رابط 

ويشغل الصوت ويكتبلي بالشات حجم الصوت كام 

يعني كام ثانية الصوت

هادي تطلع الصوت 0


sound = playSound3D(link, -1233.9285888672, 456.3063659668, 6.4603748321533, true) 
length_s = getSoundLength(sound)
outputChatBox(length_s,255,0,0,true)

 

link = ?

  • Like 1
Posted

يحذف او يغلق

سويت تايمر بحيث يطلع ال lenth بعد 5 ثواني

عشان يكون جاب الصوت من اللينك واشتغل 

@N3xT

@!#NssoR_)

330xum0.jpg

p_862d3zvf1.png

* تم آلآفتتآح مرة اخري , حياكم الله *

ip : * mtasa://145.239.212.62:22003 *

330xum0.jpg

Posted

احذف التايمر واستعمل الحدث التالي, التايمر خطأ ممكن بعد 5 ثواني الصوت باقي ما اشتغل

onClientSoundStarted

 

 

 

Posted
46 minutes ago, N3xT said:

احذف التايمر واستعمل الحدث التالي, التايمر خطأ ممكن بعد 5 ثواني الصوت باقي ما اشتغل


onClientSoundStarted

 

يب صح . تمام

330xum0.jpg

p_862d3zvf1.png

* تم آلآفتتآح مرة اخري , حياكم الله *

ip : * mtasa://145.239.212.62:22003 *

330xum0.jpg

  • 2 weeks later...
Posted
On 02/07/2019 at 00:37, N3xT said:

احذف التايمر واستعمل الحدث التالي, التايمر خطأ ممكن بعد 5 ثواني الصوت باقي ما اشتغل


onClientSoundStarted

 

كيف اتحقق من اسم الصوت في هذا الحدث ؟

330xum0.jpg

p_862d3zvf1.png

* تم آلآفتتآح مرة اخري , حياكم الله *

ip : * mtasa://145.239.212.62:22003 *

330xum0.jpg

Posted
54 minutes ago, Mr.Mostafa said:

كيف اتحقق من اسم الصوت في هذا الحدث ؟

اعتقد كذا


sound = playSound3D(link, -1233.9285888672, 456.3063659668, 6.4603748321533, true)
addEventHandler("onClientSoundStarted", sound,
  function(rsn)
    if rsn == "play" then
      length_s = getSoundLength(sound)
      outputChatBox(length_s,255,0,0,true)
    end
  end
)

 

ان شاء الله ما يكون هريسه

Posted
1 hour ago, +Source|> said:

اعتقد كذا


sound = playSound3D(link, -1233.9285888672, 456.3063659668, 6.4603748321533, true)
addEventHandler("onClientSoundStarted", sound,
  function(rsn)
    if rsn == "play" then
      length_s = getSoundLength(sound)
      outputChatBox(length_s,255,0,0,true)
    end
  end
)

 

ان شاء الله ما يكون هريسه

sound = playSound3D(link, -1233.9285888672, 456.3063659668, 6.4603748321533, true)
addEventHandler("onClientSoundStarted", sound,
  function(rsn)
    if rsn == "play" and source == sound then
      length_s = getSoundLength(sound)
      outputChatBox(length_s,255,0,0,true)
    end
  end
)

 

Discord ID : nxFairlywell#6895

 

Posted (edited)
3 hours ago, +Source|> said:

ان شاء الله ما يكون هريسه

أتمنى لو ما كان عندك كود واثق منه, ماتطرحه عشان مايطول الموضوع وتضيع وقت الأخ بدون فائدة.

Edited by iMr.WiFi..!

Experienced MTA developer for 4 years. | MTA خبرة 4 سنين في برمجة

ليس عليك اسعاد الجميع ,
ولكن عليك بإن لا تؤذي أحداً 

=========
You do not have to make everyone happy,
But you should not hurt anyone

 

Want to contact with me?

 

Discord: JustCarry#2616 (Always there)
Skype: Live:JustCarry10 (Not always)

Posted
5 hours ago, NX_CI said:

sound = playSound3D(link, -1233.9285888672, 456.3063659668, 6.4603748321533, true)
addEventHandler("onClientSoundStarted", sound,
  function(rsn)
    if rsn == "play" and source == sound then
      length_s = getSoundLength(sound)
      outputChatBox(length_s,255,0,0,true)
    end
  end
)

 

تحققك ماله داعي, لأن الحدث على الصوت نفسه

نهاية سطر 2

 

 

Posted
55 minutes ago, N3xT said:

تحققك ماله داعي, لأن الحدث على الصوت نفسه

نهاية سطر 2

ما قريت سطر الإيفنت كامل =D

Discord ID : nxFairlywell#6895

 

Posted
14 hours ago, iMr.WiFi..! said:

أتمنى لو ما كان عندك كود واثق منه, ماتطرحه عشان مايطول الموضوع وتضيع وقت الأخ بدون فائدة.

انا قلت مجرد افتراض

وانا ذكرت اني مب متأكد منه

لو ما يبي يجرب براحته

Posted
addEvent ( "setTheDSound", true )
addEventHandler ( "setTheDSound", root,
	function(link)
				if ( isElement ( mysound ) ) then destroyElement ( mysound ) end

					mysound = playSound3D(link, -1233.9285888672, 456.3063659668, 6.4603748321533, true) 
					setSoundMaxDistance(mysound, 25)
					setSoundVolume(mysound, 20.0)
					guiSetEnabled(GUIEditor.button[1], false)

	end
)


addEventHandler("onClientSoundStarted", mysound,
  function(rsn)
   if rsn == "play" then
	  outputChatBox("started",255,0,0,true)
      length_s = getSoundLength(mysound)
      outputChatBox(length_s,255,0,0,true)
    end
  end
)

ما اشتغل ?

@N3xT

@NX_CI

330xum0.jpg

p_862d3zvf1.png

* تم آلآفتتآح مرة اخري , حياكم الله *

ip : * mtasa://145.239.212.62:22003 *

330xum0.jpg

Posted (edited)
addEventHandler("onClientSoundStarted", resourceRoot, function(reason)
    if source == mysound and reason == "play" then
        outputChatBox("started", 255, 0, 0, true)
        local length_s = getSoundLength(source)
        outputChatBox(tostring(length_s), 255, 0, 0, true)
    end
end)

 

Edited by #,xiRocKyz
Posted
5 hours ago, #,xiRocKyz said:

addEventHandler("onClientSoundStarted", resourceRoot, function(reason)
    if source == mysound and reason == "play" then
        outputChatBox("started", 255, 0, 0, true)
        local length_s = getSoundLength(source)
        outputChatBox(tostring(length_s), 255, 0, 0, true)
    end
end)


 

ما ظبط + ما يطلع شي في الشات ض

330xum0.jpg

p_862d3zvf1.png

* تم آلآفتتآح مرة اخري , حياكم الله *

ip : * mtasa://145.239.212.62:22003 *

330xum0.jpg

Posted
1 hour ago, Mr.Mostafa said:

ما ظبط + ما يطلع شي في الشات ض

تأكد من تطابق السورس مع تعريف المتغير الذي تم انشائه لتشغيل الصوت.

Experienced MTA developer for 4 years. | MTA خبرة 4 سنين في برمجة

ليس عليك اسعاد الجميع ,
ولكن عليك بإن لا تؤذي أحداً 

=========
You do not have to make everyone happy,
But you should not hurt anyone

 

Want to contact with me?

 

Discord: JustCarry#2616 (Always there)
Skype: Live:JustCarry10 (Not always)

Posted
Just now, iMr.WiFi..! said:

تأكد من تطابق السورس مع تعريف المتغير الذي تم انشائه لتشغيل الصوت.

متاكد منه

330xum0.jpg

p_862d3zvf1.png

* تم آلآفتتآح مرة اخري , حياكم الله *

ip : * mtasa://145.239.212.62:22003 *

330xum0.jpg

Posted
addEventHandler("onClientSoundStream",root,function ( Type , Length )
if ( source == mysound and Type ) then 
outputChatBox("Length: "..math.floor(Length))
end
end)

 

Discord  : H2KAN#4072

Posted
5 minutes ago, Hakan said:

addEventHandler("onClientSoundStream",root,function ( Type , Length )
if ( source == mysound and Type ) then 
outputChatBox("Length: "..math.floor(Length))
end
end)

 

كفو , تسلم

330xum0.jpg

p_862d3zvf1.png

* تم آلآفتتآح مرة اخري , حياكم الله *

ip : * mtasa://145.239.212.62:22003 *

330xum0.jpg

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...