Jump to content

x{مشكلة}x فتح لوحة الدي اكس


Recommended Posts

السلام عليكم انا اتعلم برمجة الدي اكس جديد بس عندي مشكلة لماذا اللوحة لا تفتح

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 
  
  
  
  
  
  
GUIEditor = { 
    button = {}, 
} 
GUIEditor.button[1] = guiCreateButton(277, 231, 35, 54, "", true) 
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") 
  
addEventHandler("onClientRender", root, 
    function edit () 
        dxDrawRectangle(203, 174, 298, 186, tocolor(0, 113, 255, 255), true) 
        dxDrawRectangle(277, 232, 139, 63, tocolor(255, 255, 255, 255), true) 
    end 
) 
  
  
  
  
sShowing = false 
bindKey("f1","down", function ( ) 
if ( sShowing == true ) then 
removeEventHandler("onClientRender",root,dx_test) 
showCursor ( false ) 
else 
addEventHandler("onClientRender",root,edit) 
showCursor ( true ) 
end 
sShowing = not sShowing 
end 
) 

Edited by Guest
Link to comment
  function dx_test () 
  
        dxDrawRectangle(203, 174, 298, 186, tocolor(0, 113, 255, 255), true) 
  
        dxDrawRectangle(277, 232, 139, 63, tocolor(255, 255, 255, 255), true) 
  
    end 
  
  
sShowing = false 
  
bindKey("f1","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 
  
) 

خطأك كان

editانك حاطط اسم فنكشن

dx_testواسم الفنكشن بالحدث

كمان انت عامل الفنكشن مع حدث اول ما نشغل المود وحدث بس نضغط على اف 1

فاذا ضغطت اف 1

راح يجي خطأ انو الحدث مشغل من قبل

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