magnux Posted December 5, 2020 Posted December 5, 2020 SEGUINTE RAPAZIADA QUERIA CLICK EM UMA BOTAO E FECHA OS OUTROS E ABRIR O QUE EU TAVA CLIKANDO EXEMPLO : CLICK NO SALA DAI FICA FECHADO REGREAS E INFOR, DAI CLICK EM REGREAS AI FECHA SALA E INFOR AJUDA PF . function SalasOn (_,state) if painellobby == true then if state == "down" then if isCursorOnElement (x*22, y*288, x*181, y*53) then addEventHandler ("onClientRender", root, salas) showCursor (true) painellobby = false painellobby2 = true painellobby3 = false painellobby4 = false end end end end addEventHandler ("onClientClick", root, SalasOn) function RegrasOn (_,state) if painellobby == true then if state == "down" then if isCursorOnElement (x*20, y*350, x*165, y*58) then addEventHandler ("onClientRender", root, regras) showCursor (true) painellobby = false painellobby2 = false painellobby3 = true painellobby4 = false end end end end addEventHandler ("onClientClick", root, RegrasOn) function InforOn (_,state) if painellobby == true then if state == "down" then if isCursorOnElement (x*25, y*418, x*242, y*56) then addEventHandler ("onClientRender", root, infor) showCursor (true) painellobby = false painellobby2 = false painellobby3 = false painellobby4 = true end end end end addEventHandler ("onClientClick", root, InforOn)
Moderators Lord Henry Posted December 7, 2020 Moderators Posted December 7, 2020 Código ilegível. Favor indente seu código. 1 Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment Discord Oficial do MTA: https://mtasa.com/discord Blacklist e Whitelist de Scripters: Planilha Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.
HiroShi Posted December 23, 2020 Posted December 23, 2020 On 05/12/2020 at 01:02, magnux said: SEGUINTE RAPAZIADA QUERIA CLICK EM UMA BOTAO E FECHA OS OUTROS E ABRIR O QUE EU TAVA CLIKANDO EXEMPLO : CLICK NO SALA DAI FICA FECHADO REGREAS E INFOR, DAI CLICK EM REGREAS AI FECHA SALA E INFOR AJUDA PF . function SalasOn (_,state) if painellobby == true then if state == "down" then if isCursorOnElement (x*22, y*288, x*181, y*53) then addEventHandler ("onClientRender", root, salas) showCursor (true) painellobby = false painellobby2 = true painellobby3 = false painellobby4 = false end end end end addEventHandler ("onClientClick", root, SalasOn) function RegrasOn (_,state) if painellobby == true then if state == "down" then if isCursorOnElement (x*20, y*350, x*165, y*58) then addEventHandler ("onClientRender", root, regras) showCursor (true) painellobby = false painellobby2 = false painellobby3 = true painellobby4 = false end end end end addEventHandler ("onClientClick", root, RegrasOn) function InforOn (_,state) if painellobby == true then if state == "down" then if isCursorOnElement (x*25, y*418, x*242, y*56) then addEventHandler ("onClientRender", root, infor) showCursor (true) painellobby = false painellobby2 = false painellobby3 = false painellobby4 = true end end end end addEventHandler ("onClientClick", root, InforOn) Esse código está com uma logíca muito mal elaborada, invés de vc criar 4 variaveis, você poderia criar apenas 1, e invés de 4 functions vc precisiraria criar apenas 1. Então vms lá, vou transformar somente em 1 variavel e 1 função. aba = 1 -- variavel que define as abas clickPostions = { -- cordenada de cada botão { }, --bote aqui o cordenada do botão 1. {22, 288, 181, 53}, {20, 350, 165, 58}, {25, 418, 242, 56}, } addEventHandler ("onClientClick", root, function(_, s) if (painellobby) == true and (s) == 'down' then for i,v in ipairs(clickPostions) do if isCursorOnElement (x*v[1], y*v[2], x*v[3], y*v[4]) then aba = i end end end end) lembrando que deverá fazer umas alteraçoes no seu onClientRender Te ajudei ?, Avalia aew pls .-. (desculpa eu não ter gorro de natal, eu odeio natal ) OldNick: VictorScripting Discord: vs hiro$hi#6667 GitHub: Hiroshi-Nagaza
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