Jump to content

dx زر


fsdfdsf

Recommended Posts

Use this function :

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 

local x, y, w, h = 1021, 21, 27, 24 
dxDrawRectangle(x, y, w, h, tocolor(0, 0, 0, 200), true) -- Create DX button 
dxDrawText("X", 1021, 21, 1048, 45, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "center", false, false, true, false, false) -- Create DX text 
  
addEventHandler ( "onClientClick", root, -- Event 
function (_, state ) -- Function 
    if ( state == "down" ) then -- If ( the state of the button was down ) then 
        if ( isMouseInPosition(x, y, w, h) ) then --  If ( your mouse is in the correct postion ) then 
        -- Functions 
        end -- End if 
    end -- End if 
end -- End function 
) 

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