Maybe I show all code:
function firstGUI(player)
--******************************** REGISTER WINDOW
local X_okienko_GUI = 300
local Y_okienko_GUI = 250
local Width_okienko_GUI = 360
local Height_okienko_GUI = 220
register = guiCreateWindow(X_okienko_GUI, Y_okienko_GUI, Width_okienko_GUI, Height_okienko_GUI, "Panel rejestracji", false)
--******************************** LABEL USERNAME
X_Label1 = 0.0825
Y_Label1 = 0.2
Width_Label1 = 0.25
Height_Label1 = 0.25
guiCreateLabel(X_Label1, Y_Label1, Width_Label1, Height_Label1, "Enter username:", true, register)
--******************************** LABEL PASSWORD
X_Label2 = 0.0825
Y_Label2 = 0.5
Width_Label2 = 0.25
Height_Label2 = 0.25
guiCreateLabel(X_Label2, Y_Label2, Width_Label2, Height_Label2, "Enter password:", true, register)
--******************************** ENTER USERNAME
X_Pole_User = 0.415
Y_Pole_User = 0.17
Width_Pole_User = 0.5
Height_Pole_User = 0.15
pole_User = guiCreateEdit(X_Pole_User, Y_Pole_User, Width_Pole_User, Height_Pole_User, "", true, register)
--******************************** ENTER PASSWORD
X_Pole_Pass = 0.415
Y_Pole_Pass = 0.47
Width_Pole_Pass = 0.5
Height_Pole_Pass = 0.15
pole_Pass = guiCreateEdit(X_Pole_Pass, Y_Pole_Pass, Width_Pole_Pass, Height_Pole_Pass, "", true, register)
--******************************** BUTTON REGISTER
X_button_Reg = 0.2
Y_button_Reg = 0.7
Width_button_Reg = 0.25
Height_button_Reg = 0.2
btnRegister = guiCreateButton(X_button_Reg, Y_button_Reg, Width_button_Reg, Height_button_Reg, "Register", true, register)
--******************************** BUTTON CANCEL
X_button_Cancel = 0.6
Y_button_Cancel = 0.7
Width_button_Cancel = 0.25
Height_button_Cancel = 0.2
btnCancel = guiCreateButton(X_button_Cancel, Y_button_Cancel, Width_button_Cancel, Height_button_Cancel, "Cancel", true, register)
--******************************** END
guiWindowSetSizable(register, false)
guiSetVisible ( register, true )
showCursor(true) -- pokazanie kursora
[[--if btnCancel~=nil then
outputChatBox("Canceled operation...")
end --]]
addEventHandler("onClientGUIClick", btnCancel, zamknijgui, false)
end
addCommandHandler("gui", firstGUI)
-- BUTTON CLICK EVENT
function zamknijgui()
outputChatBox("Zamknąłeś GUI")
end