3B00DG4MER Posted January 12, 2015 Posted January 12, 2015 (edited) Hi Guys, Today i making a new script dx GUI for my server BLAH Blah blah ..... what i want is How to trigger Event onClientRender and check if Left Mouse is Down without onClientClick Event cuz it will gives lagg on Event "OnClientRender" local sW, sH = guiGetScreenSize() function dxDrawButton(x, y, w, h, text, color, borderColor,font) local font = font or "pricedown" dxDrawRectangle(x ,y ,w ,h, color) dxDrawRectangle(x, y, w, 1, borderColor) dxDrawRectangle(x, y, 1, h, borderColor) dxDrawRectangle(x, y + h, w, 1, borderColor) dxDrawRectangle(x + w, y , 1, h, borderColor) if text then dxDrawText ( text, x, y, x + w, y + h, tocolor(31,31,31), 1, font, "center", "center") end if isMouseWithinRangeOf(x, y, w, h) then dxDrawRectangle(x ,y,w,h,tocolor(0,255,255)) -- I think here i put the event but i've to check first if Mouse Stat (if left Mouse is down) if text then dxDrawText ( text, x, y , x + w, y + h, tocolor(255,255,255), 1, font, "center", "center") end end end function isMouseWithinRangeOf(posX, posY, sizeX, sizeY) if isCursorShowing() == false then return false end local cx,cy = getCursorPosition() cx,cy = cx*sW,cy*sH if cx >= posX and cx <= posX+sizeX and cy >= posY and cy <= posY+sizeY then return true,cx,cy else return false end end Edited January 12, 2015 by Guest SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
Dealman Posted January 12, 2015 Posted January 12, 2015 Can't you use getKeyState instead of onClientClick? If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
3B00DG4MER Posted January 12, 2015 Author Posted January 12, 2015 Can't you use getKeyState instead of onClientClick? Next time, i've to Save wiki on my Brian Thanks SAF/SAO - 30% Skype: Themerzoug2020 in-game name:3B00DG4MER
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