w7sH Posted June 18, 2016 Share Posted June 18, 2016 معي هذا الزر اذا ضغط عليه يشغل صوت واذا ضغط ع الزر الثاني يطفيه انا ابيه يطفى ويشتغل بزر واحد نفس الزر if source == GUIEditor.button[2] then if not isPedInVehicle(localPlayer) then return outputChatBox("",255,0255,0,true) end; if isElement(sound) then destroyElement(sound) sound = nil end sound = playSound("مسار الصوت",true) elseif source == GUIEditor.button[2] then if isElement(sound) then destroyElement(sound) sound = nil end elseif ( source == GUIEditor.button[2] ) then end end ) حطيته نفس الزر لكن حصلت مشكلة Link to comment
iMr.SFA7 Posted June 18, 2016 Share Posted June 18, 2016 السلام عليكم سوي تحقـق اذا كان الصـوت مـوجود يسحبـه واذا ماكان موجود يشغـل الصـوت Link to comment
Mr.R Posted June 18, 2016 Share Posted June 18, 2016 الي فهمته من كودك وكلامك انك تبيه يشغل ويطفي الصوت من نفس الزر + مايشتغل الصوت الا اذا كان الاعب داخل سياره جرب #Client addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == GUIEditor.button[2] ) then if not ( isPedInVehicle ( localPlayer ) ) then return outputChatBox ( "* الرجاء ركوب السيارهـ", 255, 255, 255, true ) end if isElement ( Sound ) then destroyElement ( Sound ) end Sound = playSound ( "مسار الصوت", true ) else if isElement ( Sound ) then destroyElement ( Sound ) Sound = nil end end end ) Link to comment
iMr.SFA7 Posted June 18, 2016 Share Posted June 18, 2016 الي فهمته من كودك وكلامك انك تبيه يشغل ويطفي الصوت من نفس الزر + مايشتغل الصوت الا اذا كان الاعب داخل سيارهجرب #Client addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == GUIEditor.button[2] ) then if not ( isPedInVehicle ( localPlayer ) ) then return outputChatBox ( "* الرجاء ركوب السيارهـ", 255, 255, 255, true ) end if isElement ( Sound ) then destroyElement ( Sound ) end Sound = playSound ( "مسار الصوت", true ) else if isElement ( Sound ) then destroyElement ( Sound ) Sound = nil end end end ) طيب خله يحـاول؟ وكودك خطأ Link to comment
Mr.R Posted June 18, 2016 Share Posted June 18, 2016 نخليه يحآول , ونخلي غيره يحاول ولا تزعل وش الخطأ -____- >?? Link to comment
iMr.SFA7 Posted June 18, 2016 Share Posted June 18, 2016 سطر 9 أنت مسـوي عـكس للتـحقق الي بسطـر 2 if ( source == GUIEditor.button[2] ) then GUIEditor.button[2] وهـذا يعني أنه اذا ضغط على الزر الي متغـيره أنت سويته يتحقق اذا كان في موتر مايسوي الوظيفة وقفلت التحقق وبعدها سويت اذا كان الصوت موجود يسحبـه ويكمل الوظيفة المفروض توقف الوظيفة باختصار يعني اذا ضغط على الزر الي بالكود بيشغل الصوت واذا ضغط على أي زر بالسكربت يوقف الصوت Link to comment
w7sH Posted June 18, 2016 Author Share Posted June 18, 2016 نخليه يحآول , ونخلي غيره يحاول ولا تزعلوش الخطأ -____- >?? كودك م يشتغل .. Link to comment
Mr.R Posted June 18, 2016 Share Posted June 18, 2016 سطر 9 أنت مسـوي عـكس للتـحقق الي بسطـر 2 if ( source == GUIEditor.button[2] ) then GUIEditor.button[2] وهـذا يعني أنه اذا ضغط على الزر الي متغـيره أنت سويته يتحقق اذا كان في موتر مايسوي الوظيفة وقفلت التحقق وبعدها سويت اذا كان الصوت موجود يسحبـه ويكمل الوظيفة المفروض توقف الوظيفة باختصار يعني اذا ضغط على الزر الي بالكود بيشغل الصوت واذا ضغط على أي زر بالسكربت يوقف الصوت طيب هذا الكود , صلحته وجربته اشتغل تمام , بس فيه مشكله وحده ماعرفت احلها وتواجهني دايماً وهي اي شيء اضغطه يطفي الصوت , المفروض الزر نفسه لما اضغطه مره ثانيه يطفي الصوت ^ ياليت تفيدنا addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == GUIEditor.button[2] ) then if not ( isPedInVehicle ( localPlayer ) ) then return outputChatBox ( "* الرجاء ركوب السيارهـ", 255, 255, 255, true ) end if isElement ( Sound ) then destroyElement ( Sound ) end Sound = playSound ( "مسار الصوت" ) else if isElement ( Sound ) then stopSound ( Sound ) Sound = nil end end end ) Link to comment
iMr.SFA7 Posted June 18, 2016 Share Posted June 18, 2016 addEventHandler ( "onClientGUIClick", resourceRoot, function() if (source == GUIEditor.button[2]) then if not ( isPedInVehicle ( localPlayer ) ) then return outputChatBox ( "* الرجاء ركوب السيارهـ", 255, 255, 255, true ) end if Sound and isElement ( Sound ) then destroyElement ( Sound ) Sound = nil return end Sound = playSound ( "مسار الصوت" ) end end ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now