Jump to content

help plz plz


Recommended Posts

hi )

i was make a bank system for my server and he woork but when i disied to make the script work withe press key the window is work but hte botton no this is the lua wher is the proplem plz any help :oops::oops::oops:

local screenwidth, screenheight = guiGetScreenSize () 
local posw, posh = 324, 262 
  
BankSys_TabPanel = {} 
BankSys_Tab = {} 
BankSys_Label = {} 
  
bankwindow = guiCreateWindow(screenwidth/2-posw/2,screenheight/2-posh/2,324,262,"BANK SYSTEM",false) 
BankSys_Label[1] = guiCreateLabel(10,25,301,16,"was creat by Mr.Co00oL ",false,bankwindow) 
guiLabelSetColor(BankSys_Label[1],0,0,255) 
guiLabelSetVerticalAlign(BankSys_Label[1],"top") 
guiLabelSetHorizontalAlign(BankSys_Label[1],"left",false) 
guiSetFont(BankSys_Label[1],"default-bold-small") 
BankSys_TabPanel[1] = guiCreateTabPanel(10,95,301,111,false,bankwindow) 
BankSys_Tab[1] = guiCreateTab("Deposit / Cash Out",BankSys_TabPanel[1]) 
btnDeposit = guiCreateButton(70,20,141,23,"deposit amount",false,BankSys_Tab[1]) 
btnWithdraw = guiCreateButton(70,50,141,23,"pay off amount",false,BankSys_Tab[1]) 
BankSys_Tab[2] = guiCreateTab("about ways",BankSys_TabPanel[1]) 
BankSys_Label[2] = guiCreateLabel(10,10,131,21,"send to",false,BankSys_Tab[2]) 
guiLabelSetColor(BankSys_Label[2],255,255,255) 
guiLabelSetVerticalAlign(BankSys_Label[2],"top") 
guiLabelSetHorizontalAlign(BankSys_Label[2],"left",false) 
editTransfer = guiCreateEdit(150,10,131,21,"",false,BankSys_Tab[2]) 
btnTransfer = guiCreateButton(70,50,141,23,"Be remitted amount",false,BankSys_Tab[2]) 
BankSys_Label[3] = guiCreateLabel(10,55,81,21,"amount",false,bankwindow) 
guiLabelSetColor(BankSys_Label[3],255,255,255) 
guiLabelSetVerticalAlign(BankSys_Label[3],"top") 
guiLabelSetHorizontalAlign(BankSys_Label[3],"left",false) 
editBetrag = guiCreateEdit(70,55,113,21,"0",false,bankwindow) 
BankSys_Label[4] = guiCreateLabel(190,55,46,21,"$",false,bankwindow) 
guiLabelSetColor(BankSys_Label[4],255,255,255) 
guiLabelSetVerticalAlign(BankSys_Label[4],"top") 
guiLabelSetHorizontalAlign(BankSys_Label[4],"left",false) 
btnBalance = guiCreateButton(10,215,141,23,"balances acconte",false,bankwindow) 
btnCloseBank = guiCreateButton(230,215,75,23,"close",false,bankwindow) 
  
function round(num, idp) 
    local mult = 10^(idp or 0) 
    return math.floor(num * mult + 0.5) / mult 
end 
  
addEventHandler( "onClientResourceStart", getRootElement( ), 
    function ( ) 
        guiSetVisible(bankwindow, false) 
    end 
); 
         guiSetVisible (bankwindow, false)   
function OpenWin() 
    if guiGetVisible ( bankwindow ) then 
       guiSetVisible ( bankwindow, false ) 
       showCursor(false) 
       guiSetInputEnabled(false) 
    else 
        guiSetVisible ( bankwindow, true ) 
        showCursor(true) 
        guiSetInputEnabled(true) 
  
    end 
end 
bindKey("F2", "down", OpenWin) 
  
  
  
  
  
function btnCloseBankFunc ( button, state ) 
    if button == "left" and state == "up" then 
        guiSetInputEnabled ( false ) 
        guiSetVisible ( bankwindow, false ) 
        showCursor ( false ) 
    end 
end 
  
function btnDepositFunc ( button, state ) 
    if button == "left" and state == "up" then 
        local bsUser = getLocalPlayer() 
        local bsBetrag = round ( tonumber ( guiGetText ( editBetrag ) ), 0 ) 
        triggerServerEvent ( "doBSDeposit", getLocalPlayer(), bsUser, bsBetrag ) 
    end 
end 
  
function btnWithdrawFunc ( button, state ) 
    if button == "left" and state == "up" then 
        local bsUser = getLocalPlayer() 
        local bsBetrag = round ( tonumber ( guiGetText ( editBetrag ) ), 0 ) 
        triggerServerEvent ( "doBSWithdraw", getLocalPlayer(), bsUser, bsBetrag ) 
    end 
end 
  
function btnTransferFunc ( button, state ) 
    if button == "left" and state == "up" then 
        local bsUser = getLocalPlayer() 
        local bsTarget = guiGetText ( editTransfer ) 
        local bsBetrag = round ( tonumber ( guiGetText ( editBetrag ) ), 0 ) 
        triggerServerEvent ( "doBSTransfer", getLocalPlayer(), bsUser, bsTarget, bsBetrag ) 
    end 
end 
  
function btnBalanceFunc ( button, state ) 
    if button == "left" and state == "up" then 
        local bsUser = getLocalPlayer() 
        triggerServerEvent ( "doBSBalance", getLocalPlayer(), bsUser ) 
    end 
end ) 
  

PLZ help :(

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