HU/IsInSlot

From Multi Theft Auto: Wiki
Revision as of 20:01, 3 November 2019 by Anadropol (talk | contribs) (→‎Returns)
Jump to navigation Jump to search

Szintaxis

isInSlot(x, y, width, height)

Vissza térési értékek

Ha a cursor a dobozban van akkor a visszatérési érték 'igaz' különben pedig 'hamis'

írta Petrik

Code

Click to collapse [-]
Client
    local x,y = guiGetScreenSize()
    function isInSlot(dX, dY, dSZ, dM) --Creating function isInSlot
        if isCursorShowing() then --If your cursor showing
            local cX ,cY = getCursorPosition() --Get your cursor position
            cX,cY = cX*x , cY*y --Get cursor position on the resolution
            if(cX >= dX and cX <= dX+dSZ and cY >= dY and cY <= dY+dM) then --If cursor in the position given
                return true, cX, cY --If in the position return true
            else
                return false --If not in the position return false
            end
        end
    end