Jump to content

تعـــديل لوحة اصوات


Recommended Posts

GUIEditor_Button = {} 
GUIEditor_Checkbox = {} 
GUIEditor_Label = {} 
GUIEditor_Scrollbar = {} 
  
wnd = guiCreateWindow(0.645,0.0166,0.355,0.4217,"اصوات",true) 
GUIEditor_Checkbox[1] = guiCreateCheckBox(24,38,100,23,"0",false,false,wnd) 
GUIEditor_Checkbox[2] = guiCreateCheckBox(24,92,100,23,"1",false,false,wnd) 
GUIEditor_Checkbox[3] = guiCreateCheckBox(24,148,100,23,"2",false,false,wnd) 
GUIEditor_Checkbox[4] = guiCreateCheckBox(151,38,100,23,"3",false,false,wnd) 
GUIEditor_Checkbox[5] = guiCreateCheckBox(151,91,100,23,"4",false,false,wnd) 
GUIEditor_Checkbox[6] = guiCreateCheckBox(151,148,100,23,"5",false,false,wnd) 
GUIEditor_Button[1] = guiCreateButton(11,208,68,24,"اغلاق",false,wnd) 
GUIEditor_Button[2] = guiCreateButton(144,208,68,24,"موافق",false,wnd) 
GUIEditor_Label[1] = guiCreateLabel(91,230,107,19,"",false,wnd) 
guiSetVisible(wnd, false) 
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 
  
addEventHandler("onClickGUIClick", root, click) 
  
click = function() 
if (source == GUIEditor_Button[1]) then 
guiSetVisible(wnd, false) 
showCursor( false ) 
   end 
end 
  
      
    sound = playSound ( "1.mp3", true ) 
    setSoundVolume ( sound, 0.5 ) 
    setSoundPaused ( sound, true ) 
      
  
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[1]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( getLocalPlayer() ), "kmh" ) 
if theSpeed >= 20 then 
    setSoundPaused ( sound, false ) 
else 
    setSoundPaused ( sound, true ) 
        end 
    end 
end 
)        
--------------- 
addEventHandler("onClickGUIClick", root, click) 
  
      
    sound = playSound ( "2.mp3", true ) 
    setSoundVolume ( sound, 0.5 ) 
    setSoundPaused ( sound, true ) 
      
  
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[2]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( getLocalPlayer() ), "kmh" ) 
if theSpeed >= 20 then 
    setSoundPaused ( sound, false ) 
else 
    setSoundPaused ( sound, true ) 
        end 
    end 
end 
)     
------------------------- 
  
addEventHandler("onClickGUIClick", root, click) 
  
      
    sound = playSound ( "3.mp3", true ) 
    setSoundVolume ( sound, 0.5 ) 
    setSoundPaused ( sound, true ) 
      
  
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[3]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( getLocalPlayer() ), "kmh" ) 
if theSpeed >= 20 then 
    setSoundPaused ( sound, false ) 
else 
    setSoundPaused ( sound, true ) 
        end 
    end 
end 
)    
---------------------- 
  
addEventHandler("onClickGUIClick", root, click) 
  
      
    sound = playSound ( "4.mp3", true ) 
    setSoundVolume ( sound, 0.5 ) 
    setSoundPaused ( sound, true ) 
      
  
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[4]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( getLocalPlayer() ), "kmh" ) 
if theSpeed >= 20 then 
    setSoundPaused ( sound, false ) 
else 
    setSoundPaused ( sound, true ) 
        end 
    end 
end 
)               
---------------------------------- 
  
addEventHandler("onClickGUIClick", root, click) 
  
      
    sound = playSound ( "5.mp3", true ) 
    setSoundVolume ( sound, 0.5 ) 
    setSoundPaused ( sound, true ) 
      
  
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[5]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( getLocalPlayer() ), "kmh" ) 
if theSpeed >= 20 then 
    setSoundPaused ( sound, false ) 
else 
    setSoundPaused ( sound, true ) 
        end 
    end 
end 
)     
-------------------------- 
  
addEventHandler("onClickGUIClick", root, click) 
  
      
    sound = playSound ( "6.mp3", true ) 
    setSoundVolume ( sound, 0.5 ) 
    setSoundPaused ( sound, true ) 
      
  
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[6]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( getLocalPlayer() ), "kmh" ) 
if theSpeed >= 20 then 
    setSoundPaused ( sound, false ) 
else 
    setSoundPaused ( sound, true ) 
        end 
    end 
end 
)           
  
  

الكود شغال وكل شي

بسس المشكلة انه يشغل نفس الصوت

يعني ما يتغير الصوت

Edited by Guest
Link to comment
GUIEditor_Button = {} 
GUIEditor_Checkbox = {} 
GUIEditor_Label = {} 
GUIEditor_Scrollbar = {} 
  
wnd = guiCreateWindow(0.645,0.0166,0.355,0.4217,"اصوات",true) 
GUIEditor_Checkbox[1] = guiCreateCheckBox(24,38,100,23,"0",false,false,wnd) 
GUIEditor_Checkbox[2] = guiCreateCheckBox(24,92,100,23,"1",false,false,wnd) 
GUIEditor_Checkbox[3] = guiCreateCheckBox(24,148,100,23,"2",false,false,wnd) 
GUIEditor_Checkbox[4] = guiCreateCheckBox(151,38,100,23,"3",false,false,wnd) 
GUIEditor_Checkbox[5] = guiCreateCheckBox(151,91,100,23,"4",false,false,wnd) 
GUIEditor_Checkbox[6] = guiCreateCheckBox(151,148,100,23,"5",false,false,wnd) 
GUIEditor_Button[1] = guiCreateButton(11,208,68,24,"اغلاق",false,wnd) 
GUIEditor_Button[2] = guiCreateButton(144,208,68,24,"موافق",false,wnd) 
GUIEditor_Label[1] = guiCreateLabel(91,230,107,19,"H.R",false,wnd) 
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("F2", "down", OpenWin) 
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 
  
addEventHandler("onClickGUIClick", root, click) 
  
click = function() 
if (source == GUIEditor_Button[1]) then 
guiSetVisible(wnd, false) 
showCursor( false ) 
   end 
end 
  
      
    sound = playSound ( "1.wav", true ) 
    setSoundVolume ( sound, 0.5 ) 
    setSoundPaused ( sound, true ) 
      
  
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[1]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( getLocalPlayer() ), "kmh" ) 
if theSpeed >= 20 then 
    setSoundPaused ( sound, false ) 
else 
    setSoundPaused ( sound, true ) 
        end 
    end 
end 
)       
--------------- 
addEventHandler("onClickGUIClick", root, click) 
  
      
    sound = playSound ( "2.wav", true ) 
    setSoundVolume ( sound, 0.5 ) 
    setSoundPaused ( sound, true ) 
      
  
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[2]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( getLocalPlayer() ), "kmh" ) 
if theSpeed >= 20 then 
    setSoundPaused ( sound, false ) 
else 
    setSoundPaused ( sound, true ) 
        end 
    end 
end 
)     
------------------------- 
  
addEventHandler("onClickGUIClick", root, click) 
  
      
    sound = playSound ( "3.wav", true ) 
    setSoundVolume ( sound, 0.5 ) 
    setSoundPaused ( sound, true ) 
      
  
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[3]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( getLocalPlayer() ), "kmh" ) 
if theSpeed >= 20 then 
    setSoundPaused ( sound, false ) 
else 
    setSoundPaused ( sound, true ) 
        end 
    end 
end 
)   
---------------------- 
  
addEventHandler("onClickGUIClick", root, click) 
  
      
    sound = playSound ( "4.wav", true ) 
    setSoundVolume ( sound, 0.5 ) 
    setSoundPaused ( sound, true ) 
      
  
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[4]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( getLocalPlayer() ), "kmh" ) 
if theSpeed >= 20 then 
    setSoundPaused ( sound, false ) 
else 
    setSoundPaused ( sound, true ) 
        end 
    end 
end 
)               
---------------------------------- 
  
addEventHandler("onClickGUIClick", root, click) 
  
      
    sound = playSound ( "5.wav", true ) 
    setSoundVolume ( sound, 0.5 ) 
    setSoundPaused ( sound, true ) 
      
  
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[5]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( getLocalPlayer() ), "kmh" ) 
if theSpeed >= 20 then 
    setSoundPaused ( sound, false ) 
else 
    setSoundPaused ( sound, true ) 
        end 
    end 
end 
)     
-------------------------- 
  
addEventHandler("onClickGUIClick", root, click) 
  
      
    sound = playSound ( "6.wav", true ) 
    setSoundVolume ( sound, 0.5 ) 
    setSoundPaused ( sound, true ) 
      
  
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[6]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( getLocalPlayer() ), "kmh" ) 
if theSpeed >= 20 then 
    setSoundPaused ( sound, false ) 
else 
    setSoundPaused ( sound, true ) 
        end 
    end 
end 
) 
  
--------------------------------------------------- 
  
  
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[1]) == true) then 
guiCheckBoxSetSelected(GUIEditor_Checkbox[2],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[3],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[4],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[5],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[6],false) 
elseif (guiCheckBoxGetSelected(GUIEditor_Checkbox[2]) == true) then 
guiCheckBoxSetSelected(GUIEditor_Checkbox[1],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[3],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[4],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[5],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[6],false) 
elseif (guiCheckBoxGetSelected(GUIEditor_Checkbox[3]) == true) then 
guiCheckBoxSetSelected(GUIEditor_Checkbox[1],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[2],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[4],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[5],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[6],false) 
elseif (guiCheckBoxGetSelected(GUIEditor_Checkbox[4]) == true) then 
guiCheckBoxSetSelected(GUIEditor_Checkbox[1],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[2],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[3],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[5],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[6],false) 
elseif (guiCheckBoxGetSelected(GUIEditor_Checkbox[5]) == true) then 
guiCheckBoxSetSelected(GUIEditor_Checkbox[1],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[2],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[3],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[4],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[6],false) 
elseif (guiCheckBoxGetSelected(GUIEditor_Checkbox[6]) == true) then 
guiCheckBoxSetSelected(GUIEditor_Checkbox[1],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[2],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[3],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[4],false) 
guiCheckBoxSetSelected(GUIEditor_Checkbox[5],false) 
   end 
end 
) 

يصير كذا ؟

Link to comment

-- لم يتم التجربة

GUIEditor_Button = {} 
GUIEditor_Checkbox = {} 
GUIEditor_Label = {} 
GUIEditor_Scrollbar = {} 
  
wnd = guiCreateWindow(0.645,0.0166,0.355,0.4217,"اصوات",true) 
GUIEditor_Checkbox[1] = guiCreateCheckBox(24,38,100,23,"0",false,false,wnd) 
GUIEditor_Checkbox[2] = guiCreateCheckBox(24,92,100,23,"1",false,false,wnd) 
GUIEditor_Checkbox[3] = guiCreateCheckBox(24,148,100,23,"2",false,false,wnd) 
GUIEditor_Checkbox[4] = guiCreateCheckBox(151,38,100,23,"3",false,false,wnd) 
GUIEditor_Checkbox[5] = guiCreateCheckBox(151,91,100,23,"4",false,false,wnd) 
GUIEditor_Checkbox[6] = guiCreateCheckBox(151,148,100,23,"5",false,false,wnd) 
GUIEditor_Button[1] = guiCreateButton(11,208,68,24,"اغلاق",false,wnd) 
GUIEditor_Button[2] = guiCreateButton(144,208,68,24,"موافق",false,wnd) 
GUIEditor_Label[1] = guiCreateLabel(91,230,107,19,"",false,wnd) 
guiSetVisible(wnd, false) 
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 
addEventHandler("onClickGUIClick", root, 
  
function() 
if (source == GUIEditor_Button[1]) then 
guiSetVisible(wnd, false) 
showCursor( false ) 
elseif (source == GUIEditor_Button[2]) then 
guiSetVisible(wnd, false) 
showCursor( false ) 
   end 
end) 
-------------------------------------- 
sound = playSound ( "1.mp3", true ) 
setSoundVolume ( sound, 0.5 ) 
setSoundPaused ( sound, true ) 
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[1]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( localPlayer ), "kmh" ) 
if theSpeed >= 20 then 
setSoundPaused ( sound, false ) 
else 
setSoundPaused ( sound, true ) 
        end 
    end 
end 
)       
------------------------ 
sound2 = playSound ( "2.mp3", true ) 
setSoundVolume ( sound2, 0.5 ) 
setSoundPaused ( sound2, true ) 
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[2]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( localPlayer ), "kmh" ) 
if theSpeed >= 20 then 
setSoundPaused ( sound2, false ) 
else 
setSoundPaused ( sound2, true ) 
        end 
    end 
end 
)     
------------------------ 
sound3 = playSound ( "3.mp3", true ) 
setSoundVolume ( sound3, 0.5 ) 
setSoundPaused ( sound3, true ) 
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[3]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( localPlayer ), "kmh" ) 
if theSpeed >= 20 then 
setSoundPaused ( sound3, false ) 
else 
setSoundPaused ( sound3, true ) 
        end 
    end 
end 
)   
---------------------- 
sound4 = playSound ( "4.mp3", true ) 
setSoundVolume ( sound4, 0.5 ) 
setSoundPaused ( sound4, true ) 
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[4]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( localPlayer ), "kmh" ) 
if theSpeed >= 20 then 
setSoundPaused ( sound4, false ) 
else 
setSoundPaused ( sound4, true ) 
        end 
    end 
end 
)               
---------------------------------- 
sound5 = playSound ( "5.mp3", true ) 
setSoundVolume ( sound5, 0.5 ) 
setSoundPaused ( sound5, true ) 
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[5]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( localPlayer ), "kmh" ) 
if theSpeed >= 20 then 
setSoundPaused ( sound5, false ) 
else 
setSoundPaused ( sound5, true ) 
        end 
    end 
end 
)     
-------------------------- 
sound6 = playSound ( "6.mp3", true ) 
setSoundVolume ( sound6, 0.5 ) 
setSoundPaused ( sound6, true ) 
addEventHandler("onClientRender", root, 
function() 
if (guiCheckBoxGetSelected(GUIEditor_Checkbox[6]) == true) then 
local theSpeed = getElementSpeed ( getPedOccupiedVehicle ( getLocalPlayer() ), "kmh" ) 
if theSpeed >= 20 then 
setSoundPaused ( sound6, false ) 
else 
setSoundPaused ( sound6, true ) 
        end 
    end 
end 
) 

Link to comment

اولآ : ما راح يشتغل الصوت الا اذا مشيت.

ثانيآ : لو وخرت الصح وتمشي ما راح يشتغل

ثالثأ : هو اصلا ما يشتغل الا اذا مشيت كيف تبي بالزر :lol:

رابعآ : اسألك بالله الذي لا اله الا هو انك ما تحطه اغاني

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