FAHD+18 Posted July 10, 2016 Share Posted July 10, 2016 السلام عليكم ورحمه الله وبركاتة اتمني مساعدتكم واي شخص محترف في الدي اكس لا يبخل المشكلة هي اللوحة لا تريد ان تفتح وانا ابرمجها فياريت كل شخص يقلي شو الخطا انا مبرمج اللوحة من اولها لاخرها اتمني المساعدة هاد مود اغاني دي اكس فية مشكلة معرف ما هي + انا حاطط موسيقة !! function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing ( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end function dx_test ( ) dxDrawRectangle(121, 149, 494, 298, tocolor(0, 0, 0, 255), false) dxDrawRectangle(121, 150, 494, 43, tocolor(23, 23, 23, 255), false) dxDrawRectangle(121, 379, 494, 72, tocolor(23, 23, 23, 255), false) dxDrawText("Music", 298, 150, 420, 193, tocolor(255, 255, 255, 255), 1.30, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("OMGF - Hello Remix [ Trap ]", 140, 210, 340, 223, tocolor(255, 255, 255, 255), 1.12, "clear", "left", "top", false, false, false, false, false) if ( isMouseInPosition (481, 205, 107, 25) ) then dxDrawRectangle(481, 205, 107, 25, tocolor(13, 119, 126, 200), false) else dxDrawRectangle(481, 205, 107, 25, tocolor(13, 119, 126, 255), false) end dxDrawRectangle(395, 205, 76, 25, tocolor(13, 119, 126, 255), false) dxDrawText("ON / OFF", 395, 204, 471, 230, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("25,000", 481, 204, 589, 229, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawLine(122, 194, 614, 194, tocolor(13, 119, 126, 255), 1, false) dxDrawLine(123, 379, 615, 379, tocolor(13, 119, 126, 255), 1, false) dxDrawText("Benny Cinema [ Remix ] ", 140, 243, 340, 256, tocolor(255, 255, 255, 255), 1.12, "clear", "left", "top", false, false, false, false, false) dxDrawRectangle(395, 240, 76, 25, tocolor(13, 119, 126, 255), false) dxDrawRectangle(481, 239, 107, 25, tocolor(13, 119, 126, 255), false) dxDrawText("RIGHT IN [ Remix ]", 140 - 1, 276 - 1, 340 - 1, 289 - 1, tocolor(0, 0, 0, 255), 1.12, "clear", "left", "top", false, false, false, false, false) dxDrawText("RIGHT IN [ Remix ]", 140 + 1, 276 - 1, 340 + 1, 289 - 1, tocolor(0, 0, 0, 255), 1.12, "clear", "left", "top", false, false, false, false, false) dxDrawText("RIGHT IN [ Remix ]", 140 - 1, 276 + 1, 340 - 1, 289 + 1, tocolor(0, 0, 0, 255), 1.12, "clear", "left", "top", false, false, false, false, false) dxDrawText("RIGHT IN [ Remix ]", 140 + 1, 276 + 1, 340 + 1, 289 + 1, tocolor(0, 0, 0, 255), 1.12, "clear", "left", "top", false, false, false, false, false) dxDrawText("RIGHT IN [ Remix ]", 140, 276, 340, 289, tocolor(255, 255, 255, 255), 1.12, "clear", "left", "top", false, false, false, false, false) dxDrawRectangle(395, 274, 76, 25, tocolor(13, 119, 126, 255), false) dxDrawRectangle(481, 274, 107, 25, tocolor(13, 119, 126, 255), false) dxDrawText("BANGARANGE [ Remix ]", 140 - 1, 311 - 1, 315 - 1, 311 - 1, tocolor(0, 0, 0, 255), 1.12, "clear", "left", "top", false, false, false, false, false) dxDrawText("BANGARANGE [ Remix ]", 140 + 1, 311 - 1, 315 + 1, 311 - 1, tocolor(0, 0, 0, 255), 1.12, "clear", "left", "top", false, false, false, false, false) dxDrawText("BANGARANGE [ Remix ]", 140 - 1, 311 + 1, 315 - 1, 311 + 1, tocolor(0, 0, 0, 255), 1.12, "clear", "left", "top", false, false, false, false, false) dxDrawText("BANGARANGE [ Remix ]", 140 + 1, 311 + 1, 315 + 1, 311 + 1, tocolor(0, 0, 0, 255), 1.12, "clear", "left", "top", false, false, false, false, false) dxDrawText("BANGARANGE [ Remix ]", 140, 311, 315, 311, tocolor(255, 255, 255, 255), 1.12, "clear", "left", "top", false, false, false, false, false) dxDrawRectangle(395, 309, 76, 25, tocolor(13, 119, 126, 255), false) dxDrawRectangle(481, 309, 107, 25, tocolor(13, 119, 126, 255), false) dxDrawText("KYOTO [ Remix ]", 140, 346, 340, 359, tocolor(255, 255, 255, 255), 1.12, "clear", "left", "top", false, false, false, false, false) dxDrawRectangle(395, 344, 76, 25, tocolor(13, 119, 126, 255), false) dxDrawRectangle(481, 344, 107, 25, tocolor(13, 119, 126, 255), false) dxDrawText("ON / OFF", 395, 239, 471, 265, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("ON / OFF", 395, 273, 471, 299, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("ON / OFF", 395, 309, 471, 335, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("ON / OFF", 395, 343, 471, 369, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("25,000", 480, 240, 588, 265, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("25,000", 480, 273, 588, 298, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("25,000", 480, 309, 588, 334, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("25,000", 480, 343, 588, 368, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) end local sShowing = false bindKey("F4","down", function ( ) if ( sShowing == true ) then removeEventHandler("onClientRender",root,dx_test) showCursor ( false ) else addEventHandler("onClientRender",root,dx_test) showCursor ( true ) end sShowing = not sShowing end ) addEventHandler("onClientClick",root, function ( button , state ) if( button == "left" and state == "up" ) then local Sound = playSound("sound.mp3") setSoundVolume(Sound,0.5) elseif source == stop then stopSound ( Sound ) if ( isMouseInPosition (481, 205, 107, 25) ) then end end end بدي اعرف ايه الخطا !! ياريت اللي ياخدة يجربة الmeta ومسوي ملف sound واضع به الاغنية ^^ اتمني المساعدة Link to comment
AboShanab Posted July 10, 2016 Share Posted July 10, 2016 local sShowing = false function dxDrawFramedText ( message, left, top, width, height, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, frameColor, colorCoded ) color = color or tocolor ( 0, 0, 0, 50 ) frameColor = frameColor or tocolor ( 0, 0, 0, 255 ) scale = scale or 1.1 font = font or "default" alignX = alignX or "left" alignY = alignY or "top" clip = clip or false wordBreak = wordBreak or false postGUI = postGUI or false colorCoded = colorCoded or false dxDrawText ( message, left + 1, top + 1, width + 1, height + 1, frameColor, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded ) dxDrawText ( message, left + 1, top - 1, width + 1, height - 1, frameColor, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded ) dxDrawText ( message, left - 1, top + 1, width - 1, height + 1, frameColor, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded ) dxDrawText ( message, left - 1, top - 1, width - 1, height - 1, frameColor, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded ) dxDrawText ( message, left, top, width, height, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded ) end function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing ( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end function dx_test ( ) dxDrawRectangle(121, 149, 494, 298, tocolor(0, 0, 0, 255), false) dxDrawRectangle(121, 150, 494, 43, tocolor(23, 23, 23, 255), false) dxDrawRectangle(121, 379, 494, 72, tocolor(23, 23, 23, 255), false) dxDrawText("Music", 298, 150, 420, 193, tocolor(255, 255, 255, 255), 1.30, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("OMGF - Hello Remix [ Trap ]", 140, 210, 340, 223, tocolor(255, 255, 255, 255), 1.12, "clear", "left", "top", false, false, false, false, false) if ( isMouseInPosition (481, 205, 107, 25) ) then dxDrawRectangle(481, 205, 107, 25, tocolor(13, 119, 126, 200), false) else dxDrawRectangle(481, 205, 107, 25, tocolor(13, 119, 126, 255), false) end dxDrawRectangle(395, 205, 76, 25, tocolor(13, 119, 126, 255), false) dxDrawText("ON / OFF", 395, 204, 471, 230, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("25,000", 481, 204, 589, 229, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawLine(122, 194, 614, 194, tocolor(13, 119, 126, 255), 1, false) dxDrawLine(123, 379, 615, 379, tocolor(13, 119, 126, 255), 1, false) dxDrawText("Benny Cinema [ Remix ] ", 140, 243, 340, 256, tocolor(255, 255, 255, 255), 1.12, "clear", "left", "top", false, false, false, false, false) dxDrawRectangle(395, 240, 76, 25, tocolor(13, 119, 126, 255), false) dxDrawRectangle(481, 239, 107, 25, tocolor(13, 119, 126, 255), false) dxDrawFramedText("RIGHT IN [ Remix ]", 140, 276, 340, 289, tocolor(0, 0, 0, 255), 1.12, "clear", "left", "top", false, false, false, false, false) dxDrawRectangle(395, 274, 76, 25, tocolor(13, 119, 126, 255), false) dxDrawRectangle(481, 274, 107, 25, tocolor(13, 119, 126, 255), false) dxDrawFramedText("BANGARANGE [ Remix ]", 140, 311, 315, 311, tocolor(255, 255, 255, 255), 1.12, "clear", "left", "top", false, false, false, false, false) dxDrawRectangle(395, 309, 76, 25, tocolor(13, 119, 126, 255), false) dxDrawRectangle(481, 309, 107, 25, tocolor(13, 119, 126, 255), false) dxDrawText("KYOTO [ Remix ]", 140, 346, 340, 359, tocolor(255, 255, 255, 255), 1.12, "clear", "left", "top", false, false, false, false, false) dxDrawRectangle(395, 344, 76, 25, tocolor(13, 119, 126, 255), false) dxDrawRectangle(481, 344, 107, 25, tocolor(13, 119, 126, 255), false) dxDrawText("ON / OFF", 395, 239, 471, 265, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("ON / OFF", 395, 273, 471, 299, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("ON / OFF", 395, 309, 471, 335, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("ON / OFF", 395, 343, 471, 369, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("25,000", 480, 240, 588, 265, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("25,000", 480, 273, 588, 298, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("25,000", 480, 309, 588, 334, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("25,000", 480, 343, 588, 368, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) end bindKey("F4","down", function ( ) if ( sShowing == true ) then removeEventHandler("onClientRender",root,dx_test) showCursor ( false ) else addEventHandler("onClientRender",root,dx_test) showCursor ( true ) end sShowing = not sShowing end) addEventHandler("onClientClick",root, function ( button , state ) if ( button == "left" and state == "up" ) then if ( isMouseInPosition (481, 205, 107, 25) ) then local Sound = playSound("sound.mp3") setSoundVolume(Sound,0.5) elseif ( isMouseInPosition (395, 274, 76, 25) ) then stopSound ( Sound ) end end end ) Link to comment
FAHD+18 Posted July 10, 2016 Author Share Posted July 10, 2016 عندي سؤال هو ليه انت كاتب elseif ( isMouseInPosition (395, 274, 76, 25) ) then مرتين باختلاف الاحداثيات if ( isMouseInPosition (481, 205, 107, 25) ) then Link to comment
Mhmd.z Posted July 10, 2016 Share Posted July 10, 2016 عندي سؤال هو ليه انت كاتب elseif ( isMouseInPosition (395, 274, 76, 25) ) then مرتين باختلاف الاحداثيات if ( isMouseInPosition (481, 205, 107, 25) ) then يعني لو كان الماوس على زر التشغيل راح يشغل الاغنيه , لو كان على زر ايقاف الاغنيه راح يوقفها Link to comment
FAHD+18 Posted July 10, 2016 Author Share Posted July 10, 2016 انا عامل زر واحد لتشغيل والايقاف Link to comment
Mhmd.z Posted July 10, 2016 Share Posted July 10, 2016 المفروض يسوي if sound then destroyElement(sound) else sound = playerSound("sound.mp3") end Link to comment
FAHD+18 Posted July 10, 2016 Author Share Posted July 10, 2016 ممكن تعدلي علي الكود addEventHandler("onClientClick",root, function ( button , state ) if ( button == "left" and state == "up" ) then if ( isMouseInPosition (481, 205, 107, 25) ) then local Sound = playSound("sound.mp3") setSoundVolume(Sound,0.5) elseif ( isMouseInPosition (395, 274, 76, 25) ) then stopSound ( Sound ) end end end ) 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