Jump to content

طلب تعديل لوحة صوت الموتر


Recommended Posts

GUIEditor_Window = {} 
GUIEditor_Button = {}
GUIEditor_Checkbox = {}
 
GUIEditor_Window[1] = guiCreateWindow(0.6925,0.105,0.3088,0.5483,"sound By  !{F}p^Bo~L|B|/\/-M#",true)
guiSetAlpha(GUIEditor_Window[1],1)
GUIEditor_Checkbox[1] = guiCreateCheckBox(0.085,0.1094,0.1862,0.0486,"1",false,true,GUIEditor_Window[1])
guiCheckBoxSetSelected(GUIEditor_Checkbox[1],true)
guiSetFont(GUIEditor_Checkbox[1],"clear-normal")
GUIEditor_Checkbox[2] = guiCreateCheckBox(0.085,0.2888,0.1862,0.0486,"2",false,true,GUIEditor_Window[1])
guiCheckBoxSetSelected(GUIEditor_Checkbox[2],true)
GUIEditor_Checkbox[3] = guiCreateCheckBox(0.085,0.4924,0.1862,0.0486,"3",false,true,GUIEditor_Window[1])
guiCheckBoxSetSelected(GUIEditor_Checkbox[3],true)
GUIEditor_Checkbox[4] = guiCreateCheckBox(0.085,0.6748,0.1862,0.0486,"4",false,true,GUIEditor_Window[1])
guiCheckBoxSetSelected(GUIEditor_Checkbox[4],true)
guiSetFont(GUIEditor_Checkbox[4],"clear-normal")
GUIEditor_Checkbox[5] = guiCreateCheckBox(0.7773,0.1094,0.1781,0.0486,"5",false,true,GUIEditor_Window[1])
guiCheckBoxSetSelected(GUIEditor_Checkbox[5],true)
guiSetFont(GUIEditor_Checkbox[5],"clear-normal")
GUIEditor_Checkbox[6] = guiCreateCheckBox(0.7773,0.2948,0.1781,0.0486,"6",false,true,GUIEditor_Window[1])
guiCheckBoxSetSelected(GUIEditor_Checkbox[6],true)
guiSetFont(GUIEditor_Checkbox[6],"clear-normal")
GUIEditor_Checkbox[7] = guiCreateCheckBox(0.7773,0.5046,0.1781,0.0486,"7",false,true,GUIEditor_Window[1])
guiSetFont(GUIEditor_Checkbox[7],"clear-normal")
GUIEditor_Checkbox[8] = guiCreateCheckBox(0.7773,0.6717,0.1781,0.0486,"8",false,true,GUIEditor_Window[1])
guiCheckBoxSetSelected(GUIEditor_Checkbox[8],true)
guiSetFont(GUIEditor_Checkbox[8],"clear-normal")
guiSetVisible (wnd, false)
function OpenWin()
    if guiGetVisible ( wnd ) then  
       guiSetVisible ( wnd, false )    
       showCursor(false)  
       guiSetInputEnabled(false)
    else
        guiSetVisible ( wnd, true )  
        showCursor(true)  
        guiSetInputEnabled(true)
 
    end  
end  
bindKey("F10", "down", OpenWin)
 
addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick)
 
addEventHandler("onClientGUIClick", root,
        function ()
 
if ( source == GUIEditor_Checkbox[1] ) then
  function getElementSpeed ( element, unit )
        if unit == nil then unit = 0 end
        if isElement ( element ) then
            local x,y,z = getElementVelocity ( element )
            if ( unit == "mph" or unit == 1 or unit == "1" ) then
                return ( x^2 + y^2 + z^2 ) ^ 0.5 * 100
            else
                return ( x^2 + y^2 + z^2 ) ^ 0.5 * 1.61 * 100
            end
        else
            return false
        end
    end
     
    sound = playSound ( "1.mp3", true )
    setSoundVolume ( sound, 0.5 )
    setSoundPaused ( sound, true )
     
    setTimer (
        function ( )
            if isPedInVehicle ( localPlayer ) then
                local theVehicle = getPedOccupiedVehicle ( localPlayer )
                local theSpeed = getElementSpeed ( theVehicle, "kmh" )
                if theSpeed > 10 then
                    if isSoundPaused ( sound ) then
                        setSoundPaused ( sound, false )
                    end
                else
                    if not isSoundPaused ( sound ) then
                        setSoundPaused ( sound, true )
                    end
                end
            end
        end
    , 1000, 0 )
     elseif ( source == GUIEditor_Checkbox[2] ) then
       function getElementSpeed ( element, unit )
        if unit == nil then unit = 0 end
        if isElement ( element ) then
            local x,y,z = getElementVelocity ( element )
            if ( unit == "mph" or unit == 1 or unit == "1" ) then
                return ( x^2 + y^2 + z^2 ) ^ 0.5 * 100
            else
                return ( x^2 + y^2 + z^2 ) ^ 0.5 * 1.61 * 100
            end
        else
            return false
        end
    end
     
    sound = playSound ( "3.mp3", true )
    setSoundVolume ( sound, 0.5 )
    setSoundPaused ( sound, true )
     
    setTimer (
        function ( )
            if isPedInVehicle ( localPlayer ) then
                local theVehicle = getPedOccupiedVehicle ( localPlayer )
                local theSpeed = getElementSpeed ( theVehicle, "kmh" )
                if theSpeed > 10 then
                    if isSoundPaused ( sound ) then
                        setSoundPaused ( sound, false )
                    end
                else
                    if not isSoundPaused ( sound ) then
                        setSoundPaused ( sound, true )
                    end
                end
            end
        end
    , 1000, 0 )
     elseif ( source == GUIEditor_Checkbox[3] ) then
            function getElementSpeed ( element, unit )
        if unit == nil then unit = 0 end
        if isElement ( element ) then
            local x,y,z = getElementVelocity ( element )
            if ( unit == "mph" or unit == 1 or unit == "1" ) then
                return ( x^2 + y^2 + z^2 ) ^ 0.5 * 100
            else
                return ( x^2 + y^2 + z^2 ) ^ 0.5 * 1.61 * 100
            end
        else
            return false
        end
    end
     
    sound = playSound ( "4.mp3", true )
    setSoundVolume ( sound, 0.5 )
    setSoundPaused ( sound, true )
     
    setTimer (
        function ( )
            if isPedInVehicle ( localPlayer ) then
                local theVehicle = getPedOccupiedVehicle ( localPlayer )
                local theSpeed = getElementSpeed ( theVehicle, "kmh" )
                if theSpeed > 10 then
                    if isSoundPaused ( sound ) then
                        setSoundPaused ( sound, false )
                    end
                else
                    if not isSoundPaused ( sound ) then
                        setSoundPaused ( sound, true )
                    end
                end
            end
        end
    , 1000, 0 )
    elseif ( source == GUIEditor_Checkbox[4] ) then
               function getElementSpeed ( element, unit )
        if unit == nil then unit = 0 end
        if isElement ( element ) then
            local x,y,z = getElementVelocity ( element )
            if ( unit == "mph" or unit == 1 or unit == "1" ) then
                return ( x^2 + y^2 + z^2 ) ^ 0.5 * 100
            else
                return ( x^2 + y^2 + z^2 ) ^ 0.5 * 1.61 * 100
            end
        else
            return false
        end
    end
     
    sound = playSound ( "5.mp3", true )
    setSoundVolume ( sound, 0.5 )
    setSoundPaused ( sound, true )
     
    setTimer (
        function ( )
            if isPedInVehicle ( localPlayer ) then
                local theVehicle = getPedOccupiedVehicle ( localPlayer )
                local theSpeed = getElementSpeed ( theVehicle, "kmh" )
                if theSpeed > 10 then
                    if isSoundPaused ( sound ) then
                        setSoundPaused ( sound, false )
                    end
                else
                    if not isSoundPaused ( sound ) then
                        setSoundPaused ( sound, true )
                    end
                end
            end
        end
    , 1000, 0 )
    elseif ( source == GUIEditor_Checkbox[5] ) then
 function getElementSpeed ( element, unit )
        if unit == nil then unit = 0 end
        if isElement ( element ) then
            local x,y,z = getElementVelocity ( element )
            if ( unit == "mph" or unit == 1 or unit == "1" ) then
                return ( x^2 + y^2 + z^2 ) ^ 0.5 * 100
            else
                return ( x^2 + y^2 + z^2 ) ^ 0.5 * 1.61 * 100
            end
        else
            return false
        end
    end
     
    sound = playSound ( "6.mp3", true )
    setSoundVolume ( sound, 0.5 )
    setSoundPaused ( sound, true )
     
    setTimer (
        function ( )
            if isPedInVehicle ( localPlayer ) then
                local theVehicle = getPedOccupiedVehicle ( localPlayer )
                local theSpeed = getElementSpeed ( theVehicle, "kmh" )
                if theSpeed > 10 then
                    if isSoundPaused ( sound ) then
                        setSoundPaused ( sound, false )
                    end
                else
                    if not isSoundPaused ( sound ) then
                        setSoundPaused ( sound, true )
                    end
                end
            end
        end
    , 1000, 0 )
    elseif ( source == GUIEditor_Checkbox[6] ) then
     function getElementSpeed ( element, unit )
        if unit == nil then unit = 0 end
        if isElement ( element ) then
            local x,y,z = getElementVelocity ( element )
            if ( unit == "mph" or unit == 1 or unit == "1" ) then
                return ( x^2 + y^2 + z^2 ) ^ 0.5 * 100
            else
                return ( x^2 + y^2 + z^2 ) ^ 0.5 * 1.61 * 100
            end
        else
            return false
        end
    end
     
    sound = playSound ( "7.mp3", true )
    setSoundVolume ( sound, 0.5 )
    setSoundPaused ( sound, true )
     
    setTimer (
        function ( )
            if isPedInVehicle ( localPlayer ) then
                local theVehicle = getPedOccupiedVehicle ( localPlayer )
               
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...