CRoW,,# Posted April 25, 2013 Share Posted April 25, 2013 (edited) 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 April 25, 2013 by Guest Link to comment
CRoW,,# Posted April 25, 2013 Author Share Posted April 25, 2013 يوم احط صح ع اي مربع ما يتغير الصوت يعني يجيني نفس الصوت Link to comment
yazan Posted April 25, 2013 Share Posted April 25, 2013 انت ليه عامل كودك كذا + ما في وضيفه تغير صوت Link to comment
yazan Posted April 25, 2013 Share Posted April 25, 2013 اول شي ليه انت عامل اكثر من onClientRender onClickGUIClick ادمج كل مع بعض Link to comment
CRoW,,# Posted April 25, 2013 Author Share Posted April 25, 2013 اول شي ليه انت عامل اكثر من onClientRender onClickGUIClick ادمج كل مع بعض مشكلتي مو في تنسيق الكود مشكلتي في الصوت Link to comment
فاّرس Posted April 25, 2013 Share Posted April 25, 2013 (edited) الكود معفوس عفسسه,, + سطر 125 وين الفنكشن؟ + onClientGUIClick وش دخلها ؟؟ + اسم وظيفه الصوت كلها متشابهه بيجي خطأ Edited April 25, 2013 by Guest Link to comment
CRoW,,# Posted April 25, 2013 Author Share Posted April 25, 2013 انا حاط اصوات كثيرة لكن يجي صوت واحد بس Link to comment
فاّرس Posted April 25, 2013 Share Posted April 25, 2013 انا حاط اصوات كثيرة لكن يجي صوت واحد بس + اسم وظيفه الصوت كلها متشابهه بيجي خطأ Link to comment
CRoW,,# Posted April 25, 2013 Author Share Posted April 25, 2013 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
فاّرس Posted April 25, 2013 Share Posted April 25, 2013 -- لم يتم التجربة 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
CRoW,,# Posted April 25, 2013 Author Share Posted April 25, 2013 ضبط بس فيه بق اذا شلت الصح ما يتوقف الصوت +لو تقدر تخليه ما يشتغل الصوت الا اذا ضغط موافق Link to comment
فاّرس Posted April 26, 2013 Share Posted April 26, 2013 اولآ : ما راح يشتغل الصوت الا اذا مشيت. ثانيآ : لو وخرت الصح وتمشي ما راح يشتغل ثالثأ : هو اصلا ما يشتغل الا اذا مشيت كيف تبي بالزر رابعآ : اسألك بالله الذي لا اله الا هو انك ما تحطه اغاني Link to comment
CRoW,,# Posted April 26, 2013 Author Share Posted April 26, 2013 لا قصدي اذا حطيت صح وشلته ما يوقف الصوت +وش ابي في الاغاني بحطهه اصوات عادية Link to comment
yazan Posted April 26, 2013 Share Posted April 26, 2013 هو مو بزر) الصح لو يمشي يطلع صوت لو مو حاط صح يوقف صوت او هو ختيار بين الصوات Link to comment
فاّرس Posted April 26, 2013 Share Posted April 26, 2013 انت اصلا مو رابطه بالضغظ, + ليه لازم يضغط موافق ؟ اصلا الصوت ما بيشتغل الا لين يمشي , يعني مافيه فرق , + شيل الصح وامشي , ما راح يشتغل , Link to comment
فاّرس Posted April 26, 2013 Share Posted April 26, 2013 ^ مافي ولا مشكله يبي اذا حط صح يشتغل الصوت بعد ما يمشي, + اذا وخر الصح يطفي الصوت ما يشتغل مره ثآنيهه, + الكود الي عطيته صحيح ,, 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