Jump to content

تعديل#


Recommended Posts

معي هذا الزر اذا ضغط عليه يشغل صوت واذا ضغط ع الزر الثاني يطفيه

انا ابيه يطفى ويشتغل بزر واحد نفس الزر

  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

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

جرب

#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
الي فهمته من كودك وكلامك انك تبيه يشغل ويطفي الصوت من نفس الزر + مايشتغل الصوت الا اذا كان الاعب داخل سياره

جرب

#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

سطر 9 أنت مسـوي عـكس للتـحقق الي بسطـر 2

if ( source == GUIEditor.button[2] ) then 

GUIEditor.button[2] وهـذا يعني أنه اذا ضغط على الزر الي متغـيره

أنت سويته يتحقق اذا كان في موتر مايسوي الوظيفة وقفلت التحقق

وبعدها سويت اذا كان الصوت موجود يسحبـه ويكمل الوظيفة المفروض توقف الوظيفة

باختصار يعني اذا ضغط على الزر الي بالكود بيشغل الصوت واذا ضغط على أي زر بالسكربت يوقف الصوت

Link to comment
سطر 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
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

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