Jump to content

dxImages


#Paper

Recommended Posts

OMG, Error @ line 2: "attempt to compare number whit nil" :S

function isPointInBounds(pointx,pointy,boundx,boundy,boundw,boundh) 
  return pointx>boundx and pointy>boundy and pointx<boundw+boundx and pointy<boundy+boundh 
end 
  
function checkForCursorInImage() 
local pointx, pointy, worldx, worldy, worldz = getCursorPosition" class="kw4">getCursorPosition" class="kw4">getCursorPosition() * guiGetScreenSize() 
if isPointInBounds(pointx,pointy,x + barX + 35,13 + textMove - 10,100,75) then 
    showStatsWindow() 
end 
end 
addEventHandler("onClientCursorMove", root, checkForCursorInImage) 
 

EDIT: i tryed whit this:

function isPointInBounds(pointx,pointy,boundx,boundy,boundw,boundh) 
    if pointx>boundx then 
        if pointy>boundy then 
            if pointxthen 
                if pointythen 
                    return true 
                else 
                    return false 
                end 
            else 
                return false 
            end 
        else 
            return false 
        end 
    else 
        return false 
    end 
end 

and the error is @ line 3 :S

Link to comment

Use

 for the moment, [lua] is fucked up as you can see in your post.

 

[code=text]local pointx, pointy, worldx, worldy, worldz = getCursorPosition() * guiGetScreenSize() 

Ehm, that won't work...

 

  
local pointx, pointy = getCursorPosition()  
local screenx, screeny = guiGetScreenSize() 
local pointx = screenx * pointx 
local pointy = screeny * pointy 
  

Link to comment

"attempt to compare number whit nil" in this line "if pointx>boundx then"

local selectedTab 
  
function checkForCursorInImage() 
local pointx, pointy = getCursorPosition() 
local screenx, screeny = guiGetScreenSize() 
local pointx = screenx * pointx 
local pointy = screeny * pointy 
local imgX, imgY, imgW, imgH = x + barX + 35, 13 + textMove - 10, 100, 75 
if isCursorShowing() then 
    if isPointInBounds(mouseX, mouseY, imgX, imgY, imgW, imgH) then 
        selectedTab = "stats" 
        checkForTabs() 
    end 
end 
end 
addEventHandler("onClientCursorMove", root, checkForCursorInImage) 
  

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