3B00DG4MER Posted March 3, 2015 Share Posted March 3, 2015 Hi Guys, It's Dx Button How I can check here if left mouse button is UP ? function dxDrawButton(x,y,w,h,name,nameSize,borderColor,cx,cy) if (not cx) or (not cy) then cx,cy = getCursorPosition() end nameSize = nameSize or 1.00 borderColor = borderColor or tocolor(0,0,0,255) if isMouseWithinRangeOf(x,y,w,h,cx,cy) then if getKeyState("mouse1") then borderColor = tocolor(0, 100, 100, 200) else borderColor = tocolor(0, 200, 200, 200) end end dxDrawLine(x - 1, y - 1, x - 1, y + h, borderColor, 1, false) dxDrawLine(x + w, y - 1, x - 1, y - 1, borderColor, 1, false) dxDrawLine(x - 1, y + h, x + w, y + h, borderColor, 1, false) dxDrawLine(x + w, y + h, x + w, y - 1, borderColor, 1, false) dxDrawRectangle(x, y, w, h, tocolor(0, 0, 0, 150), false) dxDrawText(name, x , y , x + w, y + h, tocolor(255, 255, 255, 255), nameSize, "default", "center", "center", false, false, false, false, false) end Link to comment
TAPL Posted March 3, 2015 Share Posted March 3, 2015 This should give you the idea. addEventHandler("onClientRender", root, function() if getKeyState("mouse1") then if not isDown then isDown = true outputChatBox("Down") end else if isDown then isDown = false outputChatBox("Up") end end end) Link to comment
3B00DG4MER Posted March 3, 2015 Author Share Posted March 3, 2015 But it's stayed isDown false and i want only one Time (Cuz i can't triggerEvent 10000 Times) Link to comment
TAPL Posted March 3, 2015 Share Posted March 3, 2015 Try it and see does it output Down or Up 10000 times? no it doesn't. Link to comment
3B00DG4MER Posted March 3, 2015 Author Share Posted March 3, 2015 Oh Works Thanks Lock it Plz 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