taha201100 Posted March 29, 2016 Share Posted March 29, 2016 سويت لوحات دي اكس بالجيو ايدتور لكن ابي اسويهم مثل اللوحات العادية ازرار وكذا كيف؟؟ وش احتاج ويا ريت كل واحد جمبه وش وظيفتة Link to comment
#|_oskar_|# Posted March 29, 2016 Share Posted March 29, 2016 مافهمت ممكن توضح طلبك ؟ Link to comment
taha201100 Posted March 29, 2016 Author Share Posted March 29, 2016 مثال GUIEditor = { checkbox = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.checkbox[1] = guiCreateCheckBox(643, 433, 25, 33, "", false, false) end ) addEventHandler("onClientRender", root, function() dxDrawRectangle(419, 267, 515, 475, tocolor(31, 31, 31, 255), false) dxDrawImage(429, 345, 75, 70, ":guieditor/images/e.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("showchat", 429, 432, 578, 466, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle(422, 267, 512, 46, tocolor(255, 255, 255, 255), false) end ) الحين كيف مثلن اضيف زر بعد دي اكس Link to comment
#|_oskar_|# Posted March 29, 2016 Share Posted March 29, 2016 مثال GUIEditor = { checkbox = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.checkbox[1] = guiCreateCheckBox(643, 433, 25, 33, "", false, false) end ) addEventHandler("onClientRender", root, function() dxDrawRectangle(419, 267, 515, 475, tocolor(31, 31, 31, 255), false) dxDrawImage(429, 345, 75, 70, ":guieditor/images/e.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("showchat", 429, 432, 578, 466, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle(422, 267, 512, 46, tocolor(255, 255, 255, 255), false) end ) الحين كيف مثلن اضيف زر بعد دي اكس تبي تسوي زر داخل اللوحه الدى اكس ولو ضغط عليه يتفعل الامر ؟ Link to comment
iMr.WiFi..! Posted March 29, 2016 Share Posted March 29, 2016 تسوي زر مكان المربع حق الدي اكس بعدين تجيب الزر وتحط شفافيه الفنكشنات guiCreateButton guiSetAlpha Link to comment
taha201100 Posted March 29, 2016 Author Share Posted March 29, 2016 يب اوسكار +واي فاي الفنكشن الثاني يخفي الزر طيب الاول ينشىء الزر بس كيف احط الزر مكان معين؟؟ +الدي اكس مثل نظام اللوحة العادية اوامر ضغط وكذا؟ Link to comment
iMr.WiFi..! Posted March 29, 2016 Share Posted March 29, 2016 الدي اكس فقط لل تصميم طه حط الزر في مكان المربع addEventHandler("onClientRender", root, function() dxDrawRectangle(419, 267, 515, 475, tocolor(31, 31, 31, 255), false) dxDrawImage(429, 345, 75, 70, ":guieditor/images/e.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("showchat", 429, 432, 578, 466, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle(422, 267, 512, 46, tocolor(255, 255, 255, 255), false) end ) سوي زر مخفي , بس لا تطفيه خله شغال فخلنا نكمل شوف addEventHandler("onClientRender", root, function() dxDrawRectangle(419, 267, 515, 475, tocolor(31, 31, 31, 255), false) dxDrawImage(429, 345, 75, 70, ":guieditor/images/e.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("showchat", 429, 432, 578, 466, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle(422, 267, 512, 46, tocolor(255, 255, 255, 255), false) -- ناخذ الاحداثيات end ) button = guiCreateButton(422, 267, 512, 46, " ", false) -- نحط الاحداثيات guiSetAlpha ( button, 0 ) -- نخلي زر شغال بس مخفي Link to comment
ivor Posted March 29, 2016 Share Posted March 29, 2016 (edited) مثال GUIEditor = { checkbox = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.checkbox[1] = guiCreateCheckBox(643, 433, 25, 33, "", false, false) end ) addEventHandler("onClientRender", root, function() dxDrawRectangle(419, 267, 515, 475, tocolor(31, 31, 31, 255), false) dxDrawImage(429, 345, 75, 70, ":guieditor/images/e.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("showchat", 429, 432, 578, 466, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle(422, 267, 512, 46, tocolor(255, 255, 255, 255), false) end ) الحين كيف مثلن اضيف زر بعد دي اكس للتوضيح علي كود اخوي واي فاي GUIEditor = { checkbox = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.checkbox[1] = guiCreateCheckBox(643, 433, 25, 33, "", false, false) ex = guiCreateButton( 422, 267, 512, 46, "", true ) guiSetAlpha (ex,0.00 ) end ) addEventHandler("onClientRender", root, function() dxDrawRectangle(419, 267, 515, 475, tocolor(31, 31, 31, 255), false) dxDrawImage(429, 345, 75, 70, ":guieditor/images/e.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("showchat", 429, 432, 578, 466, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle(422, 267, 512, 46, tocolor(255, 255, 255, 255), false) ex = guiCreateButton( 422, 267, 512, 46, "", true ) guiSetAlpha (ex,0.00 ) end ) Edited March 29, 2016 by Guest Link to comment
ivor Posted March 29, 2016 Share Posted March 29, 2016 اذا كان في اي اخطاء شوف المثال بعد تشغيله بالديبق Link to comment
taha201100 Posted March 29, 2016 Author Share Posted March 29, 2016 GUIEditor = { checkbox = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.checkbox[1] = guiCreateCheckBox(506, 434, 15, 33, "", true, false) GUIEditor.checkbox[2] = guiCreateCheckBox(611, 477, 15, 33, "", true, false) GUIEditor.checkbox[3] = guiCreateCheckBox(731, 520, 15, 33, "", true, false) GUIEditor.checkbox[4] = guiCreateCheckBox(654, 563, 15, 33, "", true, false) GUIEditor.checkbox[5] = guiCreateCheckBox(639, 609, 15, 33, "", true, false) end ) addEventHandler("onClientRender", root, function() dxDrawRectangle(419, 266, 515, 475, tocolor(26, 26, 26, 255), false) dxDrawRectangle(419, 267, 515, 47, tocolor(65, 65, 65, 255), false) dxDrawText("Settings", 603, 277, 752, 311, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("ShowChat", 429, 476, 578, 510, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Changing weather", 429, 520, 578, 554, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("SHOWRADAR", 429, 564, 578, 598, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Time change", 429, 608, 578, 642, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("AFK", 429, 433, 578, 467, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("X", 908, 711, 930, 731, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawImage(428, 334, 103, 73, ":guieditor/images/w.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end ) ذي لوحه سويتها تشوفو زر x ذي مثلن ابي اخليها زر كيف ممكن احد يسوي لوحتي لكود معدل اشوف كيف تصير وافهمها Link to comment
ivor Posted March 29, 2016 Share Posted March 29, 2016 (edited) GUIEditor = { checkbox = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.checkbox[1] = guiCreateCheckBox(506, 434, 15, 33, "", true, false) GUIEditor.checkbox[2] = guiCreateCheckBox(611, 477, 15, 33, "", true, false) GUIEditor.checkbox[3] = guiCreateCheckBox(731, 520, 15, 33, "", true, false) GUIEditor.checkbox[4] = guiCreateCheckBox(654, 563, 15, 33, "", true, false) GUIEditor.checkbox[5] = guiCreateCheckBox(639, 609, 15, 33, "", true, false) exit = guiCreateButton( 908, 711, 930, 731, "", true ) guiSetAlpha (exit,0.00 ) end ) addEventHandler("onClientRender", root, function() dxDrawRectangle(419, 266, 515, 475, tocolor(26, 26, 26, 255), false) dxDrawRectangle(419, 267, 515, 47, tocolor(65, 65, 65, 255), false) dxDrawText("Settings", 603, 277, 752, 311, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("ShowChat", 429, 476, 578, 510, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Changing weather", 429, 520, 578, 554, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("SHOWRADAR", 429, 564, 578, 598, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Time change", 429, 608, 578, 642, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("AFK", 429, 433, 578, 467, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("X", 908, 711, 930, 731, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawImage(428, 334, 103, 73, ":guieditor/images/w.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end ) سويته زر تبيه زر يغلقها ؟ تم التعديل-- Edited March 29, 2016 by Guest Link to comment
MrSAUD1 Posted March 29, 2016 Share Posted March 29, 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 isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end و اذا تبي تخفي و تظهر الدي اكس , addEventHandler 'onClientRender' removeEventHandler 'onClientRender' Link to comment
ivor Posted March 29, 2016 Share Posted March 29, 2016 جرب ضعها قبل كود فتح اللوحةة addEventHandler("onClientClick", root, function () if source == exit then Dx = (not Dx) removeEventHandler ( "onClientRender",root,dx) end end) Link to comment
MrSAUD1 Posted March 29, 2016 Share Posted March 29, 2016 انا صرحتن ما فهمتكم المفترض انك مسوي Dx مو gui فـ الافضل تسخدم الوضيفة الى اعطتيك فوق تضيف احداثيات الزر و تحقق لو ان اللدي اكس ظاهر ول لا ! Link to comment
ivor Posted March 29, 2016 Share Posted March 29, 2016 هوا مسوي لوحه هريسه و أحنا نخليها جاتوه :] Link to comment
Me[Z]oO Posted March 30, 2016 Share Posted March 30, 2016 جربضعها قبل كود فتح اللوحةة addEventHandler("onClientClick", root, function () if source == exit then Dx = (not Dx) removeEventHandler ( "onClientRender",root,dx) end end) ي ليت لا تحط ردود ولا تنسخ وتلصق قبل م تفهم ام الموضوع Link to comment
N3xT Posted March 31, 2016 Share Posted March 31, 2016 done = false 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 isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end function taha() -- أسم الفنكشن الخاص باللوحة dxDrawRectangle(419, 266, 515, 475, tocolor(26, 26, 26, 255), false) dxDrawRectangle(419, 267, 515, 47, tocolor(65, 65, 65, 255), false) dxDrawText("Settings", 603, 277, 752, 311, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("ShowChat", 429, 476, 578, 510, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Changing weather", 429, 520, 578, 554, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("SHOWRADAR", 429, 564, 578, 598, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Time change", 429, 608, 578, 642, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("AFK", 429, 433, 578, 467, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("X", 908, 711, 930, 731, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawImage(428, 334, 103, 73, ":guieditor/images/w.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end bindKey("x","down", -- الزر لإظهار اللوحة function ( ) if done == false then addEventHandler("onClientRender", getRootElement(), taha) -- حدث إظهار اللوحة showCursor(true) done = true else removeEventHandler("onClientRender", getRootElement(), taha) -- حدث إخفاء اللوحة done = false showCursor(false) end end ) addEventHandler("onClientClick",root, -- ' x ' جدث الظغط على زر الخروج function ( button , state ) if ( button == "left" and state == "up" ) then if ( isMouseInPosition(908, 711, 930, 731)) then -- إحداثيات الزر removeEventHandler("onClientRender", getRootElement(), taha) -- حدث إخفاء اللوحة showCursor(false) end end end ) Link to comment
Jupi Posted March 31, 2016 Share Posted March 31, 2016 done = false 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 isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end function taha() -- أسم الفنكشن الخاص باللوحة dxDrawRectangle(419, 266, 515, 475, tocolor(26, 26, 26, 255), false) dxDrawRectangle(419, 267, 515, 47, tocolor(65, 65, 65, 255), false) dxDrawText("Settings", 603, 277, 752, 311, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("ShowChat", 429, 476, 578, 510, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Changing weather", 429, 520, 578, 554, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("SHOWRADAR", 429, 564, 578, 598, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Time change", 429, 608, 578, 642, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("AFK", 429, 433, 578, 467, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("X", 908, 711, 930, 731, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawImage(428, 334, 103, 73, ":guieditor/images/w.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end bindKey("x","down", -- الزر لإظهار اللوحة function ( ) if done == false then addEventHandler("onClientRender", getRootElement(), taha) -- حدث إظهار اللوحة showCursor(true) done = true else removeEventHandler("onClientRender", getRootElement(), taha) -- حدث إخفاء اللوحة done = false showCursor(false) end end ) addEventHandler("onClientClick",root, -- ' x ' جدث الظغط على زر الخروج function ( button , state ) if ( button == "left" and state == "up" ) then if ( isMouseInPosition(908, 711, 930, 731)) then -- إحداثيات الزر removeEventHandler("onClientRender", getRootElement(), taha) -- حدث إخفاء اللوحة showCursor(false) end end end ) ليه حاطت isEventHandlerAdded Link to comment
N3xT Posted March 31, 2016 Share Posted March 31, 2016 done = false 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 isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end function taha() -- أسم الفنكشن الخاص باللوحة dxDrawRectangle(419, 266, 515, 475, tocolor(26, 26, 26, 255), false) dxDrawRectangle(419, 267, 515, 47, tocolor(65, 65, 65, 255), false) dxDrawText("Settings", 603, 277, 752, 311, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("ShowChat", 429, 476, 578, 510, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Changing weather", 429, 520, 578, 554, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("SHOWRADAR", 429, 564, 578, 598, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Time change", 429, 608, 578, 642, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("AFK", 429, 433, 578, 467, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("X", 908, 711, 930, 731, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawImage(428, 334, 103, 73, ":guieditor/images/w.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end bindKey("x","down", -- الزر لإظهار اللوحة function ( ) if done == false then addEventHandler("onClientRender", getRootElement(), taha) -- حدث إظهار اللوحة showCursor(true) done = true else removeEventHandler("onClientRender", getRootElement(), taha) -- حدث إخفاء اللوحة done = false showCursor(false) end end ) addEventHandler("onClientClick",root, -- ' x ' جدث الظغط على زر الخروج function ( button , state ) if ( button == "left" and state == "up" ) then if ( isMouseInPosition(908, 711, 930, 731)) then -- إحداثيات الزر removeEventHandler("onClientRender", getRootElement(), taha) -- حدث إخفاء اللوحة showCursor(false) end end end ) ليه حاطت isEventHandlerAdded للآن م فهمت فائدة الكود , بس الأخ سعود طرحه ف توقعت منه فائدة + اللي فهمته من الكود ، إنه إذا كانت اللوحة مخفية ، الفنكشن يوقف Link to comment
#|_oskar_|# Posted April 1, 2016 Share Posted April 1, 2016 addEventHandler("onClientClick",root, -- تقدر تحذفه كذا removeEventHandler("onClientClick",root, Link to comment
Jupi Posted April 1, 2016 Share Posted April 1, 2016 done = false 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 isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end function taha() -- أسم الفنكشن الخاص باللوحة dxDrawRectangle(419, 266, 515, 475, tocolor(26, 26, 26, 255), false) dxDrawRectangle(419, 267, 515, 47, tocolor(65, 65, 65, 255), false) dxDrawText("Settings", 603, 277, 752, 311, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("ShowChat", 429, 476, 578, 510, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Changing weather", 429, 520, 578, 554, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("SHOWRADAR", 429, 564, 578, 598, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("Time change", 429, 608, 578, 642, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("AFK", 429, 433, 578, 467, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("X", 908, 711, 930, 731, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, false, false, false) dxDrawImage(428, 334, 103, 73, ":guieditor/images/w.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end bindKey("x","down", -- الزر لإظهار اللوحة function ( ) if done == false then addEventHandler("onClientRender", getRootElement(), taha) -- حدث إظهار اللوحة showCursor(true) done = true else removeEventHandler("onClientRender", getRootElement(), taha) -- حدث إخفاء اللوحة done = false showCursor(false) end end ) addEventHandler("onClientClick",root, -- ' x ' جدث الظغط على زر الخروج function ( button , state ) if ( button == "left" and state == "up" ) then if ( isMouseInPosition(908, 711, 930, 731)) then -- إحداثيات الزر removeEventHandler("onClientRender", getRootElement(), taha) -- حدث إخفاء اللوحة showCursor(false) end end end ) ليه حاطت isEventHandlerAdded للآن م فهمت فائدة الكود , بس الأخ سعود طرحه ف توقعت منه فائدة + اللي فهمته من الكود ، إنه إذا كانت اللوحة مخفية ، الفنكشن يوقف isEventHandlerAdded يتحقق اذا كان فيه فنكشن معين مربوط بايفينت Link to comment
SycroX Posted April 1, 2016 Share Posted April 1, 2016 By : Rock مثال dxSetVisible(functionName, true) dxSetVisible(functionName, false) function dxSetVisible (fun, vis) if (fun and vis) then if (type (fun) == "function") then if (vis == true or vis == false) then if (vis == true) then addEventHandler ("onClientRender", root, fun) else removeEventHandler ("onClientRender", root, fun) end else error ("Bad Argument At #2 Got "..type (vis)) end else error ("Bad Argument At #1 Got "..type (fun)) end end end -------------------------------------------------- function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end -- isEventHandlerAdded By Dawi function dxGetVisible (fun) if (fun and type (fun) == "function") then if (isEventHandlerAdded ("onClientRender", root, fun)) then return true else return false end end end Link to comment
MrSAUD1 Posted April 1, 2016 Share Posted April 1, 2016 @ DABL ليه حاطت isEventHandlerAdded تحقق لو كانت الدي اكس ظهار او لا , علشان لو سوا الزر بدون تحقق راح تكون مشكلة , و هي لو ضغط في نفس مكان الزر و الوحة مو مفتوحة , راح يسوي الكود الى فيها , بس لو تخلية يتحقق ان الدي اكس موجود او لا , Link to comment
N3xT Posted April 1, 2016 Share Posted April 1, 2016 @ DABL ليه حاطت isEventHandlerAdded تحقق لو كانت الدي اكس ظهار او لا , علشان لو سوا الزر بدون تحقق راح تكون مشكلة , و هي لو ضغط في نفس مكان الزر و الوحة مو مفتوحة , راح يسوي الكود الى فيها , بس لو تخلية يتحقق ان الدي اكس موجود او لا , لأهنت ع الشرح ، لأني م كنت أعرفه كنت أستعمل done = false وتحققات طويلة الخخ 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