BvH Posted March 28, 2020 Share Posted March 28, 2020 só preciso que add a função de bloquear a tecla - menos e a tecla + mais ao digitar o numero do saque e de deposito --outputChatBox --setElementData(localPlayer,"Extract.Bank","Extrato financeiro:") myFontBold10 = guiCreateFont( "bold.ttf", 10 ) myFontBold15 = guiCreateFont( "bold.ttf", 15 ) myFontAlphaMaleModern10 = guiCreateFont( "AlphaMaleModern.ttf", 13 ) function atualihoras() id="teste" time = getRealTime() local meses = {"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"} local meses2 = {"janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro"} local day = {"Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"} dia = ("%02d"):format(time.monthday) mes = meses[time.month + 1] local mes2 = meses2[time.month + 1] ano = ("%02d"):format(time.year + 1900) local diaSemana = day[time.weekday + 1] hours = time.hour minutes = time.minute local seconds = time.second if (hours >= 0 and hours < 10) then hours = "0"..time.hour end if (minutes >= 0 and minutes < 10) then minutes = "0"..time.minute end end setTimer(atualihoras,50, 0) function start() atmfundo = guiCreateStaticImage(0.00, 0.00, 1, 1, "imgs/atm.png", true) showhome() end addEvent("ShowGUI.Bank.Caixa", true) addEventHandler("ShowGUI.Bank.Caixa", getLocalPlayer(), start) function destroyerromsg() setTimer(function() if wt then destroyElement(wt) end end,2000,1) end function destroyall() if killh then destroyElement(killh) end if extratoreg then destroyElement(extratoreg) end if opc8 then destroyElement(opc8) end if bt6 then destroyElement(bt6) end if fk then destroyElement(fk) end if oplb2 then destroyElement(oplb2) destroyElement(transmoney) destroyElement(transplr) destroyElement(trs) destroyElement(oplb3) end if sac then destroyElement(sac) end if saquemoneyedit then destroyElement(saquemoneyedit) end if dep then destroyElement(dep) end if money then destroyElement(money) end if progressBar then destroyElement(progressBar) end if wt then destroyElement(wt) end if vl8 then destroyElement(vl8) destroyElement(opc8) end if vl7 then destroyElement(vl7) destroyElement(opc7) end if vl6 then destroyElement(vl6) destroyElement(opc6) end if otrvlr then destroyElement(otrvlr) destroyElement(opc4) end if vl3 then destroyElement(vl3) destroyElement(opc3) end if vl1 then destroyElement(vl1) destroyElement(opc1) end if vl2 then destroyElement(vl2) destroyElement(opc2) end if moneyedit then destroyElement(moneyedit) end if oplb1 then destroyElement(oplb1) end if infolb then destroyElement(infolb) end if bt1 then destroyElement(bt1) destroyElement(opc1) end if bt2 then destroyElement(bt2) destroyElement(opc2) end if bt3 then destroyElement(bt3) destroyElement(opc3) end if bt4 then destroyElement(bt4) destroyElement(opc4) end if bt5 then destroyElement(bt5) destroyElement(opc5) end if bt6 then destroyElement(bt6) destroyElement(opc6) end if bt7 then destroyElement(bt7) destroyElement(opc7) end if bt8 then destroyElement(bt8) destroyElement(opc8) end end function moneyfunc() local bankmoney = tonumber(getElementData(localPlayer,"bankbalance")) local handmoney = tonumber(getPlayerMoney(localPlayer)) guiBringToFront(fk) showhome() removeEventHandler("onClientGUIClick",money,moneyfunc) local fun = tonumber(sqvl) setElementData(localPlayer,"bankbalance",bankmoney-fun) local add = handmoney+fun triggerServerEvent("Bank.movimenttake", getRootElement(), localPlayer,add) local text = getElementData(localPlayer,"Extract.Bank") setElementData(localPlayer,"Extract.Bank",text.."\n\nSaque||"..hours..":"..minutes.."("..dia.."/"..mes.."/"..ano..")\nValor:"..sqvl) triggerServerEvent("Bank.moviment", getRootElement(), localPlayer) end function imprimirmoney(text,mnvl) destroyall() infolb = guiCreateLabel(0.25, 0.224, 0.5, 0.9, text, true, atmfundo) guiLabelSetHorizontalAlign(infolb, "center", false) guiSetFont(infolb, myFontBold15) oplb1 = guiCreateLabel(0.35, 0.65, 0.297, 0.3, "Contando cédulas...", true, atmfundo) scaner = playSound("scanner.mp3") guiLabelSetHorizontalAlign(oplb1, "center", false) guiSetFont(oplb1, myFontBold10) progressBar = guiCreateProgressBar(0.35, 0.68, 0.297, 0.03, true, nil) pro = setTimer(function() progress = guiProgressBarGetProgress(progressBar) guiProgressBarSetProgress(progressBar, progress+5) end,750,20) pro2 = setTimer(function() destroyElement(progressBar) killTimer(pro) destroyall() oplb1 = guiCreateLabel(0.35, 0.65, 0.297, 0.3, "Retire o dinheiro abaixo\nV V V V V V V V V V V V V V V", true, atmfundo) guiLabelSetHorizontalAlign(oplb1, "center", false) guiSetFont(oplb1, myFontBold10) stopSound(scaner) destroyElement(scaner) infolb = guiCreateLabel(0.25, 0.224, 0.5, 0.9, text, true, atmfundo) guiLabelSetHorizontalAlign(infolb, "center", false) guiSetFont(infolb, myFontBold15) local x=0.824 local y=0.950 money = guiCreateStaticImage(0.395, y, 0.21, 0.09, "imgs/money.png", true, atmfundo) fk = guiCreateStaticImage(0.351, 0.91, 0.2911, 0.09, "fk.png", true, atmfundo) setTimer(function() if y ~= 0.824 then if money then destroyElement(money) y=y-0.002 money = guiCreateStaticImage(0.395, y, 0.21, 0.09, "imgs/money.png", true, atmfundo) guiBringToFront(fk) if y <= 0.824 then y=0.824 destroyElement(money) money = guiCreateStaticImage(0.395, y, 0.21, 0.09, "imgs/money.png", true, atmfundo) guiBringToFront(fk) addEventHandler("onClientGUIClick",money,moneyfunc) end end end end,50,100) end,15000,1) end function wating(text,mnvl) destroyall() infolb = guiCreateLabel(0.25, 0.224, 0.5, 0.9, text, true, atmfundo) guiLabelSetHorizontalAlign(infolb, "center", false) guiSetFont(infolb, myFontBold15) wt = guiCreateLabel(0.25, 0.53, 0.5, 0.5, "Aguarde um momento", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold15) setTimer(function () oplb1 = guiCreateLabel(0.25, 0.565, 0.5, 0.5, "Checando banco de dados...", true, atmfundo) guiLabelSetHorizontalAlign(oplb1, "center", false) guiSetFont(oplb1, myFontBold10) end,2000,1) setTimer(function () imprimirmoney("Saque",mnvl) end,4000,1) end function watingfk(text,minitexto) destroyall() infolb = guiCreateLabel(0.25, 0.224, 0.5, 0.9, text, true, atmfundo) guiLabelSetHorizontalAlign(infolb, "center", false) guiSetFont(infolb, myFontBold15) wt = guiCreateLabel(0.25, 0.53, 0.5, 0.5, "Aguarde um momento", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold15) setTimer(function () oplb1 = guiCreateLabel(0.25, 0.565, 0.5, 0.5, minitexto, true, atmfundo) guiSetFont(oplb1, myFontBold10) guiLabelSetHorizontalAlign(oplb1, "center", false) end,2000,1) setTimer(function () showhome() end,4000,1) end function extrato() destroyall() gui="extrato" local text = getElementData(localPlayer,"Extract.Bank") or "Extrato financeiro:" infolb = guiCreateLabel(0.25, 0.224, 0.5, 0.9, "Extrato", true, atmfundo) guiLabelSetHorizontalAlign(infolb, "center", false) guiSetFont(infolb, myFontBold15) oplb1 = guiCreateLabel(0.35, 0.42, 0.5, 0.05, "Veja aqui seu extrato financeiro:", true, atmfundo) guiSetFont(oplb1, myFontBold10) opc4 = guiCreateStaticImage(0.336, 0.68, 0.161, 0.04, "imgs/fundocinza.png", true, atmfundo) tranferencia = guiCreateLabel(0, 0, 1, 1, "Apagar Extrato", true, opc4) guiSetFont(tranferencia, myFontBold10) guiLabelSetHorizontalAlign(tranferencia, "center", false) guiLabelSetVerticalAlign(tranferencia,"center",false) killh = guiCreateStaticImage(0.296, 0.68, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) guiSetAlpha(killh,0) opc5 = guiCreateStaticImage(0.511, 0.68, 0.15, 0.04, "imgs/fundocinza.png", true, atmfundo) sair = guiCreateLabel(0, 0, 1, 1, "Sair", true, opc5) guiSetFont(sair, myFontBold10) guiLabelSetHorizontalAlign(sair, "center", false) guiLabelSetVerticalAlign(sair,"center",false) bt5 = guiCreateStaticImage(0.67, 0.68, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) guiSetAlpha(bt5,0) extratoreg = guiCreateMemo(0.35, 0.47, 0.3, 0.17, text, true, atmfundo) guiMemoSetReadOnly(extratoreg, true) end function showhome() gui="home" destroyall() showCursor(true) infolb = guiCreateLabel(0.25, 0.224, 0.5, 0.9, "Bem Vindo", true, atmfundo) guiLabelSetHorizontalAlign(infolb, "center", false) guiSetFont(infolb, myFontBold15) opc1 = guiCreateStaticImage(0.34, 0.54, 0.157, 0.04, "imgs/fundocinza.png", true, atmfundo) saque = guiCreateLabel(0, 0, 1, 1, "Saque", true, opc1) guiSetFont(saque, myFontBold10) guiLabelSetHorizontalAlign(saque, "center", false) guiLabelSetVerticalAlign(saque,"center",false) opc2 = guiCreateStaticImage(0.34, 0.586, 0.157, 0.04, "imgs/fundocinza.png", true, atmfundo) deposito = guiCreateLabel(0, 0, 1, 1, "Depósito", true, opc2) guiSetFont(deposito, myFontBold10) guiLabelSetHorizontalAlign(deposito, "center", false) guiLabelSetVerticalAlign(deposito,"center",false) opc3 = guiCreateStaticImage(0.337, 0.634, 0.16, 0.04, "imgs/fundocinza.png", true, atmfundo) saldo = guiCreateLabel(0, 0, 1, 1, "Saldo", true, opc3) guiSetFont(saldo, myFontBold10) guiLabelSetHorizontalAlign(saldo, "center", false) guiLabelSetVerticalAlign(saldo,"center",false) opc4 = guiCreateStaticImage(0.336, 0.68, 0.161, 0.04, "imgs/fundocinza.png", true, atmfundo) tranferencia = guiCreateLabel(0, 0, 1, 1, "Transferência", true, opc4) guiSetFont(tranferencia, myFontBold10) guiLabelSetHorizontalAlign(tranferencia, "center", false) guiLabelSetVerticalAlign(tranferencia,"center",false) opc5 = guiCreateStaticImage(0.511, 0.68, 0.15, 0.04, "imgs/fundocinza.png", true, atmfundo) sair = guiCreateLabel(0, 0, 1, 1, "Sair", true, opc5) guiSetFont(sair, myFontBold10) guiLabelSetHorizontalAlign(sair, "center", false) guiLabelSetVerticalAlign(sair,"center",false) opc8 = guiCreateStaticImage(0.511, 0.54, 0.15, 0.04, "imgs/fundocinza.png", true, atmfundo) saqd3 = guiCreateLabel(0, 0, 1, 1, "Extrato", true, opc8) guiSetFont(saqd3, myFontBold10) guiLabelSetHorizontalAlign(saqd3, "center", false) guiLabelSetVerticalAlign(saqd3,"center",false) bt1 = guiCreateStaticImage(0.305, 0.54, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) bt2 = guiCreateStaticImage(0.302, 0.586, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) bt3 = guiCreateStaticImage(0.299, 0.634, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) bt4 = guiCreateStaticImage(0.296, 0.68, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) bt5 = guiCreateStaticImage(0.67, 0.68, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) bt6 = guiCreateStaticImage(0.669, 0.54, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) guiSetAlpha(bt1,0) guiSetAlpha(bt2,0) guiSetAlpha(bt3,0) guiSetAlpha(bt4,0) guiSetAlpha(bt5,0) guiSetAlpha(bt6,0) end function Saldofun() destroyall() local money = tonumber(getElementData(localPlayer,"bankbalance")) or 0 oplb1 = guiCreateLabel(0.35, 0.42, 0.5, 0.3, " ---------------------------------\n Saldo: \n"..money.." C\n\n\n\n----------------------------------", true, atmfundo) guiSetFont(oplb1, myFontAlphaMaleModern10) infolb = guiCreateLabel(0.25, 0.224, 0.5, 0.9, "Saldo", true, atmfundo) guiLabelSetHorizontalAlign(infolb, "center", false) guiSetFont(infolb, myFontBold15) gui="saldo" opc5 = guiCreateStaticImage(0.511, 0.68, 0.15, 0.04, "imgs/fundocinza.png", true, atmfundo) sair = guiCreateLabel(0, 0, 1, 1, "Sair", true, opc5) guiSetFont(sair, myFontBold10) guiLabelSetHorizontalAlign(sair, "center", false) guiLabelSetVerticalAlign(sair,"center",false) bt5 = guiCreateStaticImage(0.67, 0.68, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) guiSetAlpha(bt5,0) end function Depositofun() destroyall() oplb1 = guiCreateLabel(0.35, 0.42, 0.5, 0.3, "Digite o valor do depósito:\nEx: 5000", true, atmfundo) guiSetFont(oplb1, myFontBold10) infolb = guiCreateLabel(0.25, 0.224, 0.5, 0.9, "Depósito", true, atmfundo) guiLabelSetHorizontalAlign(infolb, "center", false) guiSetFont(infolb, myFontBold15) gui="deposito" moneyedit = guiCreateEdit(0.35, 0.48, 0.292, 0.045, "$$", true, atmfundo) opc4 = guiCreateStaticImage(0.336, 0.68, 0.161, 0.04, "imgs/fundocinza.png", true, atmfundo) tranferencia = guiCreateLabel(0, 0, 1, 1, "Depositar", true, opc4) guiSetFont(tranferencia, myFontBold10) guiLabelSetHorizontalAlign(tranferencia, "center", false) guiLabelSetVerticalAlign(tranferencia,"center",false) dep = guiCreateStaticImage(0.296, 0.68, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) guiSetAlpha(dep,0) opc5 = guiCreateStaticImage(0.511, 0.68, 0.15, 0.04, "imgs/fundocinza.png", true, atmfundo) sair = guiCreateLabel(0, 0, 1, 1, "Sair", true, opc5) guiSetFont(sair, myFontBold10) guiLabelSetHorizontalAlign(sair, "center", false) guiLabelSetVerticalAlign(sair,"center",false) bt5 = guiCreateStaticImage(0.67, 0.68, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) guiSetAlpha(bt5,0) end function Transf() destroyall() gui="Transferência" infolb = guiCreateLabel(0.25, 0.224, 0.5, 0.9, "Transferência", true, atmfundo) guiLabelSetHorizontalAlign(infolb, "center", false) guiSetFont(infolb, myFontBold15) oplb1 = guiCreateLabel(0.35, 0.42, 0.5, 0.3, "Digite o valor de transferência:", true, atmfundo) guiSetFont(oplb1, myFontBold10) oplb2 = guiCreateLabel(0.35, 0.485, 0.5, 0.3, "Digite o nome do jogador:", true, atmfundo) guiSetFont(oplb2, myFontBold10) oplb3 = guiCreateLabel(0.35, 0.55, 0.5, 0.3, "", true, atmfundo) guiSetFont(oplb3, myFontBold10) guiLabelSetColor(oplb3, 0, 0, 0) transmoney = guiCreateEdit(0.35, 0.45, 0.292, 0.033, "Ex: 5000", true, atmfundo) transplr = guiCreateEdit(0.35, 0.515, 0.292, 0.035, "Nome do jogador", true, atmfundo) opc4 = guiCreateStaticImage(0.336, 0.68, 0.161, 0.04, "imgs/fundocinza.png", true, atmfundo) tranferencia = guiCreateLabel(0, 0, 1, 1, "Transferir", true, opc4) guiSetFont(tranferencia, myFontBold10) guiLabelSetHorizontalAlign(tranferencia, "center", false) guiLabelSetVerticalAlign(tranferencia,"center",false) trs = guiCreateStaticImage(0.296, 0.68, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) guiSetAlpha(trs,0) opc5 = guiCreateStaticImage(0.511, 0.68, 0.15, 0.04, "imgs/fundocinza.png", true, atmfundo) sair = guiCreateLabel(0, 0, 1, 1, "Sair", true, opc5) guiSetFont(sair, myFontBold10) guiLabelSetHorizontalAlign(sair, "center", false) guiLabelSetVerticalAlign(sair,"center",false) bt5 = guiCreateStaticImage(0.67, 0.68, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) guiSetAlpha(bt5,0) end function Saqueotr() destroyall() oplb1 = guiCreateLabel(0.35, 0.42, 0.5, 0.3, "Digite o valor do Saque:\nEx: 5000", true, atmfundo) guiSetFont(oplb1, myFontBold10) infolb = guiCreateLabel(0.25, 0.224, 0.5, 0.9, "Saque", true, atmfundo) guiLabelSetHorizontalAlign(infolb, "center", false) guiSetFont(infolb, myFontBold15) gui="Saque" saquemoneyedit = guiCreateEdit(0.35, 0.48, 0.292, 0.045, "$$", true, atmfundo) opc4 = guiCreateStaticImage(0.336, 0.68, 0.161, 0.04, "imgs/fundocinza.png", true, atmfundo) tranferencia = guiCreateLabel(0, 0, 1, 1, "Sacar", true, opc4) guiSetFont(tranferencia, myFontBold10) sac = guiCreateStaticImage(0.296, 0.68, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) guiSetAlpha(sac,0) guiLabelSetHorizontalAlign(tranferencia, "center", false) guiLabelSetVerticalAlign(tranferencia,"center",false) opc5 = guiCreateStaticImage(0.511, 0.68, 0.15, 0.04, "imgs/fundocinza.png", true, atmfundo) sair = guiCreateLabel(0, 0, 1, 1, "Sair", true, opc5) guiSetFont(sair, myFontBold10) guiLabelSetHorizontalAlign(sair, "center", false) guiLabelSetVerticalAlign(sair,"center",false) bt5 = guiCreateStaticImage(0.67, 0.68, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) guiSetAlpha(bt5,0) end function Saquefun() destroyall() oplb1 = guiCreateLabel(0.35, 0.42, 0.5, 0.3, "Quanto deseja sacar?", true, atmfundo) guiSetFont(oplb1, myFontBold10) gui="saque" showCursor(true) infolb = guiCreateLabel(0.25, 0.224, 0.5, 0.9, "Saque", true, atmfundo) guiLabelSetHorizontalAlign(infolb, "center", false) guiSetFont(infolb, myFontBold15) opc1 = guiCreateStaticImage(0.34, 0.54, 0.157, 0.04, "imgs/fundocinza.png", true, atmfundo) saque = guiCreateLabel(0, 0, 1, 1, "R$1000", true, opc1) guiSetFont(saque, myFontBold10) guiLabelSetHorizontalAlign(saque, "center", false) guiLabelSetVerticalAlign(saque,"center",false) opc2 = guiCreateStaticImage(0.34, 0.586, 0.157, 0.04, "imgs/fundocinza.png", true, atmfundo) deposito = guiCreateLabel(0, 0, 1, 1, "R$2000", true, opc2) guiSetFont(deposito, myFontBold10) guiLabelSetHorizontalAlign(deposito, "center", false) guiLabelSetVerticalAlign(deposito,"center",false) opc3 = guiCreateStaticImage(0.337, 0.634, 0.16, 0.04, "imgs/fundocinza.png", true, atmfundo) saldo = guiCreateLabel(0, 0, 1, 1, "R$3000", true, opc3) guiSetFont(saldo, myFontBold10) guiLabelSetHorizontalAlign(saldo, "center", false) guiLabelSetVerticalAlign(saldo,"center",false) opc4 = guiCreateStaticImage(0.336, 0.68, 0.161, 0.04, "imgs/fundocinza.png", true, atmfundo) tranferencia = guiCreateLabel(0, 0, 1, 1, "Outro valor", true, opc4) guiSetFont(tranferencia, myFontBold10) guiLabelSetHorizontalAlign(tranferencia, "center", false) guiLabelSetVerticalAlign(tranferencia,"center",false) opc5 = guiCreateStaticImage(0.511, 0.68, 0.15, 0.04, "imgs/fundocinza.png", true, atmfundo) sair = guiCreateLabel(0, 0, 1, 1, "Sair", true, opc5) guiSetFont(sair, myFontBold10) guiLabelSetHorizontalAlign(sair, "center", false) guiLabelSetVerticalAlign(sair,"center",false) opc6 = guiCreateStaticImage(0.511, 0.634, 0.15, 0.04, "imgs/fundocinza.png", true, atmfundo) saqd1 = guiCreateLabel(0, 0, 1, 1, "R$6000", true, opc6) guiSetFont(saqd1, myFontBold10) guiLabelSetHorizontalAlign(saqd1, "center", false) guiLabelSetVerticalAlign(saqd1,"center",false) opc7 = guiCreateStaticImage(0.511, 0.586, 0.15, 0.04, "imgs/fundocinza.png", true, atmfundo) saqd2 = guiCreateLabel(0, 0, 1, 1, "R$5000", true, opc7) guiSetFont(saqd2, myFontBold10) guiLabelSetHorizontalAlign(saqd2, "center", false) guiLabelSetVerticalAlign(saqd2,"center",false) opc8 = guiCreateStaticImage(0.511, 0.54, 0.15, 0.04, "imgs/fundocinza.png", true, atmfundo) saqd3 = guiCreateLabel(0, 0, 1, 1, "R$4000", true, opc8) guiSetFont(saqd3, myFontBold10) guiLabelSetHorizontalAlign(saqd3, "center", false) guiLabelSetVerticalAlign(saqd3,"center",false) vl1 = guiCreateStaticImage(0.305, 0.54, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) vl2 = guiCreateStaticImage(0.302, 0.586, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) vl3 = guiCreateStaticImage(0.299, 0.634, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) otrvlr = guiCreateStaticImage(0.296, 0.68, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) bt5 = guiCreateStaticImage(0.67, 0.68, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) vl6 = guiCreateStaticImage(0.67, 0.634, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) vl7 = guiCreateStaticImage(0.67, 0.586, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) vl8 = guiCreateStaticImage(0.669, 0.54, 0.03, 0.04, "imgs/fundo-ret.png", true, atmfundo) guiSetAlpha(vl1,0) guiSetAlpha(vl2,0) guiSetAlpha(vl3,0) guiSetAlpha(otrvlr,0) guiSetAlpha(bt5,0) guiSetAlpha(vl6,0) guiSetAlpha(vl7,0) guiSetAlpha(vl8,0) end function botoes() local bankmoney = tonumber(getElementData(localPlayer,"bankbalance")) or 0 --outputChatBox(bankmoney) local handmoney = tonumber(getPlayerMoney(localPlayer)) if source == killh then local text = "Extrato financeiro:" guiSetText(extratoreg,text) setElementData(localPlayer,"Extract.Bank",text) end if source == bt6 then extrato() end if source == trs then if wt then destroyElement(wt) end local money = tonumber(guiGetText(transmoney)) local player = guiGetText(transplr) if money == nil then wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Quantia inválida", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() return end if money > 9000000 then wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Valor máximo R$9000000", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() return end if money < 200 then wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Valor mínimo R$200", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() return end if player == "" or player == "Nome do jogador" then wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Usuário inválido", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() return end if player ~= veryname then wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Erro! Digite o nome completo", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) veryname = nil destroyerromsg() return end if getPlayerName(localPlayer) ~= player then if money <= bankmoney then local removemoney = bankmoney - money triggerServerEvent("BankfromBanktransfer", getRootElement(), localPlayer,removemoney,player,money,hours,minutes,dia,mes,ano) local text = getElementData(localPlayer,"Extract.Bank") setElementData(localPlayer,"Extract.Bank",text.."\n\nTransferência||"..hours..":"..minutes.."("..dia.."/"..mes.."/"..ano..")\nPara:"..player.." Valor:"..money) watingfk("Transferência","Transferência feita com sucesso...") else wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Quantia inválida", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() end else wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Usuário inválido", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() end end if source == sac then if wt then destroyElement(wt) end local sac = guiGetText(saquemoneyedit) local sacn = tonumber(guiGetText(saquemoneyedit)) if bankmoney >= sacn then if sacn > 9000000 then wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Valor máximo R$9000000", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() return end wating("Saque",sac) sqvl=sacn else wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Quantia inválida", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() end end if source == otrvlr then Saqueotr() end if source == dep then if wt then destroyElement(wt) end local depmoney = tonumber(guiGetText(moneyedit)) if handmoney == getPlayerMoney() then if depmoney <= handmoney then if depmoney < 200 then wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Valor mínimo R$200", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() return end if depmoney > 9000000 then wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Valor máximo R$9000000", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() return end setElementData(localPlayer,"bankbalance",depmoney+bankmoney) local take = handmoney-depmoney triggerServerEvent("Bank.movimenttake", getRootElement(), localPlayer,take) local vlr = guiGetText(moneyedit) local text = getElementData(localPlayer,"Extract.Bank") or "Extrato financeiro:" setElementData(localPlayer,"Extract.Bank",text.."\n\nDepósito||"..hours..":"..minutes.."("..dia.."/"..mes.."/"..ano..")\nValor:"..vlr) triggerServerEvent("Bank.moviment", getRootElement(), localPlayer) watingfk("Depósito","Depósito feito com sucesso!") else wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Quantia inválida", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() end else localPlayer.setMoney(handmoney) local take = handmoney triggerServerEvent("Bank.movimenttake", getRootElement(), localPlayer,take) triggerServerEvent("Bank.moviment", getRootElement(), localPlayer) wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Erro, contate um admin!", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() end end if source == vl8 then if wt then destroyElement(wt) end if bankmoney >= 4000 then wating("Saque","4000") sqvl=4000 else wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Quantia inválida", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() end end if source == vl7 then if wt then destroyElement(wt) end if bankmoney >= 5000 then wating("Saque","5000") sqvl=5000 else wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Quantia inválida", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() end end if source == vl6 then if wt then destroyElement(wt) end if bankmoney >= 6000 then wating("Saque","6000") sqvl=6000 else wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Quantia inválida", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() end end if source == vl3 then if wt then destroyElement(wt) end if bankmoney >= 3000 then wating("Saque","3000") sqvl=3000 else wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Quantia inválida", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() end end if source == vl1 then if wt then destroyElement(wt) end if bankmoney >= 1000 then wating("Saque","1000") sqvl=1000 else wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Quantia inválida", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() end end if source == vl2 then if wt then destroyElement(wt) end if bankmoney >= 2000 then wating("Saque","2000") sqvl=2000 else wt = guiCreateLabel(0.35, 0.765, 0.297, 0.3, "Quantia inválida", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold10) guiLabelSetColor(wt, 255, 0, 0) destroyerromsg() end end if source == bt1 then Saquefun() --guiSetText(infolb,"Saque") end if source == bt2 then --guiSetText(infolb,"Deposito") Depositofun() end if source == bt3 then --guiSetText(infolb,"Saldo") Saldofun() end if source == bt4 then --guiSetText(infolb,"Transferência") Transf() end if source == bt5 then if gui ~= "home" then showhome() sqvl=0 else destroyall() infolb = guiCreateLabel(0.25, 0.224, 0.5, 0.9, "Volte Sempre", true, atmfundo) guiLabelSetHorizontalAlign(infolb, "center", false) guiSetFont(infolb, myFontBold15) wt = guiCreateLabel(0.25, 0.53, 0.5, 0.5, "Aguarde um momento", true, atmfundo) guiLabelSetHorizontalAlign(wt, "center", false) guiSetFont(wt, myFontBold15) setTimer(function () oplb1 = guiCreateLabel(0.25, 0.565, 0.5, 0.5, "Encerrando sessão...", true, atmfundo) guiSetFont(oplb1, myFontBold10) guiLabelSetHorizontalAlign(oplb1, "center", false) end,2000,1) setTimer(function () destroyElement(atmfundo) showCursor(false) triggerServerEvent("Bank.closed", getRootElement(), localPlayer) end,4000,1) end end end addEventHandler("onClientGUIClick",root,botoes) function BuscaPlayerplayermoney() if source == transplr then local text = guiGetText(transplr) if text == "" then for id, player in ipairs(getElementsByType("player")) do guiSetText(oplb3,"") end else for id, player in ipairs(getElementsByType("player")) do if string.find(string.upper(getPlayerName(player)), string.upper(text), 1, true) then guiSetText(oplb3,"Recomendado:\n"..getPlayerName(player)) veryname = getPlayerName(player) else guiSetText(oplb3,"") veryname = nil end end end end end addEventHandler("onClientGUIChanged", root,BuscaPlayerplayermoney) fileDelete("client.Lua") xtx.x Link to comment
Other Languages Moderators Lord Henry Posted March 28, 2020 Other Languages Moderators Share Posted March 28, 2020 (edited) Mais fácil vc simplesmente impedir que caracteres não numéricos apareçam naquele campo de input. Dessa forma, se apertar em alguma letra ou símbolo, não vai acontecer nada. addEventHandler ("onClientGUIChanged", moneyedit, function() guiSetText (source, string.gsub (guiGetText (source), "%D", "")) -- Apaga qualquer caractere não numérico do moneyedit. end) Edited March 28, 2020 by Lord Henry Faltou 1 parênteses. 1 Link to comment
Angelo Pereira Posted March 28, 2020 Share Posted March 28, 2020 (edited) Vou lhe ajudar, antes que você faça vários postagens com o mesmo problema, você precisa aguardar alguém lhe responder, lembre-se, ninguém é obrigado a dar-lê códigos prontos. Altere a função "BuscaPlayerplayermoney" que você já tem, por essa, adicionei o código que apenas permitirá número. function BuscaPlayerplayermoney() if source == transplr then local text = guiGetText(transplr) if text == "" then for id, player in ipairs(getElementsByType("player")) do guiSetText(oplb3,"") end else for id, player in ipairs(getElementsByType("player")) do if string.find(string.upper(getPlayerName(player)), string.upper(text), 1, true) then guiSetText(oplb3,"Recomendado:\n"..getPlayerName(player)) veryname = getPlayerName(player) else guiSetText(oplb3,"") veryname = nil end end end end if isElement(atmfundo) and guiGetVisible(atmfundo) == true then local elemento = false if isElement(transmoney) then elemento = transmoney elseif isElement(saquemoneyedit) then elemento = saquemoneyedit elseif isElement(moneyedit) then elemento = moneyedit end if elemento ~= false then local text = guiGetText(elemento) local new_text = string.gsub( text, "[^0-9]", "" ) if new_text ~= text then guiSetText(elemento, new_text) end end end end addEventHandler("onClientGUIChanged", root, BuscaPlayerplayermoney) Edited March 28, 2020 by Angelo Pereira 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now