Jump to content

[SOLVED]help dxDrawRectangle BUG


Recommended Posts

  
local screenW, screenH = guiGetScreenSize() 
  
function window() 
Kicks = isMouseWithinRangeOf(screenW * 0.6676, screenH * 0.1719, screenW * 0.0974, screenH * 0.0495) 
if Kicks then  
dxDrawRectangle(screenW * 0.6676, screenH * 0.1719, screenW * 0.0974, screenH * 0.0495, tocolor(255, 255, 255, 255), false) 
else 
dxDrawRectangle(screenW * 0.6676, screenH * 0.1719, screenW * 0.0974, screenH * 0.0495, tocolor(255, 167, 15, 255), false) 
end 
end 
addEventHandler("onClientRender", root, window) 
  
function click(playerSource) 
kick = isMouseWithinRangeOf(screenW * 0.6676, screenH * 0.1719, screenW * 0.0974, screenH * 0.0495) 
if kick then  
  triggerServerEvent("KicKPlayer", getLocalPlayer()) 
end 
end 
addEventHandler("onClientClick",getRootElement(),click) 
  
function isMouseWithinRangeOf(psx,pssx,psy,pssy) 
  if not isCursorShowing() then 
    return false 
  end 
  local cx,cy = getCursorPosition() 
  cx,cy = cx*screenW,cy*screenH 
  if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then 
    return true,cx,cy 
  else 
    return false 
  end 
end 

Edited by Guest
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...