Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: zamknięcie
1. Button nie reaguje na zamknięcie
Witam, przychodz? mo?e i ze zbyt prostym problemem, ale podczas nauki LUA nie mog? zamkn?? gui, a przycisk nie reaguje. GUI zrobione jest w dxdraw.


addEvent
("okno",true)
addEventHandler("okno"root, function(value)
if 
not value then return end
tekst 
value
showCursor
(true)
addEventHandler("onClientRender"rootostrzezenie)
        function 
warnClose()
            if 
isMouseIn(screenW 0.5555screenH 0.5875screenW 0.1008screenH 0.0653then -- miejsce buttona
            
if value then
                removeEventHandler
("onClientRender"rootostrzezenie)
                
end
            end
        end
       end
)


isMouseIn jakby kto? potrzebowa?, ale jestem pewny, ?e to dzia?a:

function isMouseIn xywidthheight )
    if ( 
not isCursorShowing( ) ) then
        
return false
    end
    local sx
sy guiGetScreenSize ( )
    
local cxcy getCursorPosition ( )
    
local cxcy = ( cx sx ), ( cy sy )
    if ( 
cx >= and cx <= width ) and ( cy >= and cy <= height then
        
return true
    
else
        return 
false
    end
end


Za pomoc stawiam :piwo: