Try this:
GUIEditor = {
tab = {},
tabpanel = {},
edit = {},
button = {},
window = {},
label = {},
checkbox = {}
}
function initializeBankPanel ()
GUIEditor.window[1] = guiCreateWindow(541, 262, 314, 226, "National Bank of San Andreas", false)
guiWindowSetMovable(GUIEditor.window[1], false)
guiWindowSetSizable(GUIEditor.window[1], false)
GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 21, 295, 196, false, GUIEditor.window[1])
GUIEditor.tab[1] = guiCreateTab("Deposit", GUIEditor.tabpanel[1])
GUIEditor.label[1] = guiCreateLabel(20, 19, 61, 15, "Amount: $", false, GUIEditor.tab[1])
GUIEditor.edit[1] = guiCreateEdit(85, 14, 182, 26, "", false, GUIEditor.tab[1])
GUIEditor.button[1] = guiCreateButton(88, 100, 124, 38, "Proceed", false, GUIEditor.tab[1])
GUIEditor.label[2] = guiCreateLabel(20, 56, 247, 15, "Your balance: $", false, GUIEditor.tab[1])
GUIEditor.tab[2] = guiCreateTab("Withdraw", GUIEditor.tabpanel[1])
GUIEditor.label[3] = guiCreateLabel(20, 19, 61, 15, "Amount: $", false, GUIEditor.tab[2])
GUIEditor.edit[2] = guiCreateEdit(85, 14, 182, 26, "", false, GUIEditor.tab[2])
GUIEditor.label[4] = guiCreateLabel(20, 56, 248, 15, "Your balance: $", false, GUIEditor.tab[2])
GUIEditor.button[2] = guiCreateButton(88, 100, 124, 38, "Proceed", false, GUIEditor.tab[2])
GUIEditor.tab[3] = guiCreateTab("Transfer", GUIEditor.tabpanel[1])
GUIEditor.label[5] = guiCreateLabel(20, 19, 61, 15, "Username:", false, GUIEditor.tab[3])
GUIEditor.label[6] = guiCreateLabel(20, 52, 61, 15, "Amount: $", false, GUIEditor.tab[3])
GUIEditor.label[7] = guiCreateLabel(20, 88, 247, 15, "Your balance: $", false, GUIEditor.tab[3])
GUIEditor.edit[3] = guiCreateEdit(85, 14, 182, 26, "", false, GUIEditor.tab[3])
GUIEditor.edit[4] = guiCreateEdit(85, 50, 182, 26, "", false, GUIEditor.tab[3])
GUIEditor.checkbox[1] = guiCreateCheckBox(270, 20, 15, 15, "", false, false, GUIEditor.tab[3])
GUIEditor.checkbox[2] = guiCreateCheckBox(270, 55, 15, 15, "", false, false, GUIEditor.tab[3])
GUIEditor.button[3] = guiCreateButton(88, 120, 124, 38, "Proceed", false, GUIEditor.tab[3])
end
bindKey ( "]", "down",
function ()
if isElement(GUIEditor.window[1]) then
destroyElement(GUIEditor.window[1])
showCursor(false)
guiSetInputEnabled(false)
else
initializeBankPanel()
showCursor(true)
guiSetInputEnabled(true)
end
end
)
player = getLocalPlayer ( )
gettab = getSelectedTab ( GUIEditor.tabpanel[1] )
function controlBankPanel ( )
if not isElement ( GUIEditor.window[1] ) then initializeBankPanel () end
if not guiGetVisible ( GUIEditor.window[1] ) then
showBankPanel ( )
else
closeBankPanel ( )
end
end
function updateBalance ()
guiSetText ( GUIEditor.label[2], "Your balance: $"..getElementData ( getLocalPlayer () ).."" )
guiSetText ( GUIEditor.label[4], "Your balance: $"..getElementData ( getLocalPlayer () ).."" )
guiSetText ( GUIEditor.label[7], "Your balance: $"..getElementData ( getLocalPlayer () ).."" )
end
function showBankPanel ()
guiSetVisible ( GUIEditor.window[1], true )
showCursor ( true )
guiSetInputEnabled ( true )
updateBalance ( )
end
function closeBankPanel()
guiSetVisible ( GUIEditor.window[1], false )
showCursor ( false )
guiSetInputEnabled ( false )
end
addEventHandler("onClientGUIClick", GUIEditor.button[1], deposit, false)
addEventHandler("onClientGUIClick", GUIEditor.button[2], withdraw, false)
addEventHandler("onClientGUIClick", GUIEditor.button[3], transfer, false)
addEventHandler("onClientGUITabSwitched", getRootElement ( ), updateBalance, false)
addEvent("showBankPanel", true)
addEvent("closeBankPanel", true)
addEventHandler("showBankPanel", getRootElement(), showBankPanel)
addEventHandler("closeBankPanel", getRootElement(), closeBankPanel)