Jump to content

أطفاء الصوت بزر


Recommended Posts

السلام عليكم,

أخباركَكم آن شاءالله بخير ومآتشكون من بآ آ س ..

  
addEventHandler("onClientResourceStart", resourceRoot, 
function() 
playSound("amg/sound.mp3") 
end) 
  
 حاولت وسويت كذا آ 
  
addEventHandler("onClientGUIClick",root, 
function () 
if ( source == stopM ) then 
stopSound( "amg/sound.mp3",false ) 
end 
end 
) 
  

يتوقف الصوت stopM أبي يوم يضغط اللاعب على زر

Link to comment
كذا قصدكك .
  
addEventHandler("onClientResourceStart", resourceRoot, 
function() 
sound = playSound("amg/sound.mp3") 
end) 
  
  
  
addEventHandler("onClientGUIClick",root, 
function () 
if ( source == stopM ) then 
stopSound( "amg/sound.mp3",false ) 
end 
end 
) 
  

نفس الشي

local sound 
addEventHandler ( "onClientResourceStart", resourceRoot, 
    function ( ) 
        sound = playSound ( "amg/sound.mp3" ) 
    end 
) 
  
addEventHandler ( "onClientGUIClick", stopM, 
    function ( ) 
        stopSound ( sound ) 
    end, false 
) 

Link to comment
كذا قصدكك .
  
addEventHandler("onClientResourceStart", resourceRoot, 
function() 
sound = playSound("amg/sound.mp3") 
end) 
  
  
  
addEventHandler("onClientGUIClick",root, 
function () 
if ( source == stopM ) then 
stopSound( "amg/sound.mp3",false ) 
end 
end 
) 
  

نفس الشي

local sound 
addEventHandler ( "onClientResourceStart", resourceRoot, 
    function ( ) 
        sound = playSound ( "amg/sound.mp3" ) 
    end 
) 
  
addEventHandler ( "onClientGUIClick", stopM, 
    function ( ) 
        stopSound ( sound ) 
    end, false 
) 

جربت ماطفي ,

Link to comment
كذا قصدكك .
  
addEventHandler("onClientResourceStart", resourceRoot, 
function() 
sound = playSound("amg/sound.mp3") 
end) 
  
  
  
addEventHandler("onClientGUIClick",root, 
function () 
if ( source == stopM ) then 
stopSound( "amg/sound.mp3",false ) 
end 
end 
) 
  

نفس الشي

local sound 
addEventHandler ( "onClientResourceStart", resourceRoot, 
    function ( ) 
        sound = playSound ( "amg/sound.mp3" ) 
    end 
) 
  
addEventHandler ( "onClientGUIClick", stopM, 
    function ( ) 
        stopSound ( sound ) 
    end, false 
) 

جربت ماطفي ,

.. إطرح كودكـ كامل مع كود إنشاء الزر

Link to comment
  
  
local sound 
addEventHandler ( "onClientResourceStart", resourceRoot, 
function ( ) 
sound = playSound ( "amg/sound.mp3" ) 
end 
) 
addEventHandler ( "onClientGUIClick", stopM, 
function ( ) 
stopSound ( sound ) 
end, false 
) 
  
  
  
wnd = guiCreateWindow(450, 227, 287, 300, "", false) 
stopM = guiCreateButton(66, 112, 156, 82, "اطفاء", false, wnd) 
guiSetVisible(wnd, false) 
  
  
bindKey("f1", "down", 
function() 
    guiSetVisible(wnd, not guiGetVisible(wnd)) 
    showCursor(guiGetVisible(wnd)) 
end) 
  
  

,

Link to comment
  
  
local sound 
addEventHandler ( "onClientResourceStart", resourceRoot, 
function ( ) 
sound = playSound ( "amg/sound.mp3" ) 
end 
) 
addEventHandler ( "onClientGUIClick", stopM, 
function ( ) 
stopSound ( sound ) 
end, false 
) 
  
  
  
wnd = guiCreateWindow(450, 227, 287, 300, "", false) 
stopM = guiCreateButton(66, 112, 156, 82, "اطفاء", false, wnd) 
guiSetVisible(wnd, false) 
  
  
bindKey("f1", "down", 
function() 
    guiSetVisible(wnd, not guiGetVisible(wnd)) 
    showCursor(guiGetVisible(wnd)) 
end) 
  
  

,

* Client Side:

local sound 
addEventHandler ( "onClientResourceStart", resourceRoot, 
    function ( ) 
        wnd = guiCreateWindow(450, 227, 287, 300, "", false) 
        stopM = guiCreateButton(66, 112, 156, 82, "اطفاء", false, wnd) 
        guiSetVisible(wnd, false) 
        sound = playSound ( "amg/sound.mp3" ) 
        addEventHandler ( "onClientGUIClick", stopM, 
            function ( ) 
                stopSound ( sound ) 
            end, false 
        ) 
    end 
) 
  
bindKey ( "F1", "down", 
    function ( ) 
        guiSetVisible ( wnd, not guiGetVisible ( wnd ) ) 
        showCursor ( guiGetVisible ( wnd ) ) 
    end 
) 

Link to comment
ابي استفيد

لو سويت زر تشغيل ممكن عطوني كود ّ!

* Client Side:

local sound       
addEventHandler ( "onClientGUIClick", اسم الزر, 
    function ( ) 
        if ( isElement ( sound ) ) then 
            destroyElement ( sound ) 
        end 
        sound = playSound ( "soundPath" ) 
    end, false 
) 

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