Jump to content

كتم الاغاني !


Recommended Posts

لم يتم التجربه
bindKey("m", "down",  --- bind key m  
function () 
if(isSoundPaused(theSound)) then 
setSoundPaused(theSound, false) -- stop sound  
outputChatBox ( "The Sound Is Stop !!", 255, 255, 255, true ) 
elseif 
setSoundPaused(theSound, true) -- run sound 
outputChatBox ( "The Sound is run !!", 255, 255, 255, true ) 
end) --- end function and Closing arc 

لا ذا الخيار في كل ماب بس انا اكتمه علاخر بدون مايتشتغل الاغاني انا بحطها بعدين بس مابي اغاني علاخر

هذه عطيته انه اول ما لاعب يدخل يطفي له كل الاصوات

لم يتم تجربه ة
function sound() 
setSoundPaused(theSound, false)  
end -- end function 
addEventHandler("onClientPlayerJoin", getRootElement(), sound) 

اول شي شكرا كثير على الكودد بس انا عشان رمضان عايز انا احط الاغاني بنفسيي مو ذي الاغاني يعني اغاني رمضان كل مرة انا اغير مثل راديو ففس

كل ذا اقول

انه كل ساعه براي

مره يبي اغاني رمضان

مره ما يبي اغاني ابدا

Link to comment

@Mr.R كودك غلط

bindKey ( "M", "down", function (  ) 
for i,v in ipairs(getElementsByType("sound")) do  
  if ( isSoundPaused ( v ) ) then 
    setSoundPaused ( v, false ) -- إيقاف مؤقت للصوت 
        else 
    setSoundPaused ( v, true ) -- تشغيل الصوت 
    end 
    end 
end ) 

Link to comment
@Mr.R كودك غلط
bindKey ( "M", "down", function (  ) 
for i,v in ipairs(getElementsByType("sound")) do  
  if ( isSoundPaused ( v ) ) then 
    setSoundPaused ( v, false ) -- إيقاف مؤقت للصوت 
        else 
    setSoundPaused ( v, true ) -- تشغيل الصوت 
    end 
    end 
end ) 

جربه شغال : )

وش دخل اللوب ؟ ^^

Link to comment

function sound()

setSoundPaused(theSound, false)

end -- end function

addEventHandler("onClientPlayerJoin", getRootElement(), sound)

الكود ذا ماشتغل وصوت حق اغاني ريس يشتغلو انا ابيهم يوقفو يعني ماعند لاعب خيار انه يشغله يضل مطفي

local sound = { ------------ جاري تجربة

[ .mp3 ] = true ------- اسم الاغنيه

[ .mp3 ] = true ------- اسم الاغنيه

[ .mp3 ] = true ------- اسم الاغنيه

[ .mp3 ] = true ------- اسم الاغنيه

[ .mp3 ] = true ------- اسم الاغنيه

}

for i, v in ipairs ( sound ) do --- عشان يوصل لجدول شو وظيفته

local sound = playSound ( v[1], v[2] )--- عشان يوصل لجدول شو وظيفته

end -- اند do

addEventHandler("onClientResourceStart", resourceRoot, -- اول ما تشغل المود

function() -- فنكش

setSoundVolume (sound, 1.0 ) -- يعطي صوت الاغنيه قوي

end) -- اند فنكش واغلاق قوس

Link to comment

تـفضل م جربته .

  
Server 
addEventHandler("onPlayerJoin",root, function ( ) 
    triggerClientEvent(source,"Stop",source) 
end) 
  
-- Client 
addEvent("Stop",true) 
addEventHandler("Stop",root, function ( ) 
    for i,k in ipairs(getElementsByType("sound")) do  
    setSoundPaused(k,false) 
end 
 end 
 ) 

Link to comment
جـربته م آشتغل . +

اللوب يجيب لك كل الاصوات الي بسيرفر و يوقفها مؤقت

ادري انه يجيب كل الاصوات بس ماله داعي

هو يبي صوت واحد معين من زر في الكيبورد

والكود كلنت عشان يطلع للاعب لحاله

Link to comment
يصير كذآ ?
addEventHandler("onClientSoundStarted",root, function ( ) 
destroyElement(source) 
end) 

لكن لازم تضيف تحقق

addEventHandler("onClientSoundStarted",root, function (reason) 
    if reason == "play" then 
        destroyElement(source) 
    end 
end) 

Link to comment

Main_Page : ي فتى تعلم الاسياسيات بالبرمجه بالرابط

guieditor . ثم سو ملف بـ سكربت

ثم جيب الفنكشات النوعين كلنت وسيرفر

Client_Scripting_Functions : فنكشات الكلنت هنا

Server_Scripting_Functions : فنكشات السيرفر هنا

Client_Scripting_Events : احداث الكلنت

Server_Scripting_Events : احداث السيرفر

lua ولا تحطم نفسك وتقول فاشل بالـ

عند طرحك الاكواد lua استخدم

Link to comment

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...