therenex Posted January 9, 2009 Posted January 9, 2009 function crearVentanaSplash ( ) ventanaSplash = guiCreateWindow ( 0.25, 0.25, 0.5, 0.5, "MTA: No More Hope", true ) guiCreateLabel ( 0.07, 0.1, 0.9, 0.1, "Para continuar, inicia tu sesion o bien crea una cuenta nueva.", true, ventanaSplash ) botonLogin = guiCreateButton ( 0.25, 0.3, 0.5, 0.2, "iniciar sesion >>", true, ventanaSplash ) botonRegistro = guiCreateButton ( 0.25, 0.55, 0.5, 0.2, "registrarse >>", true, ventanaSplash ) guiSetVisible ( ventanaSplash, true ) guiSetInputEnabled ( true ) end addEvent ( "crearSplash", true ) addEventHandler ( "onClientResourceStart", getResourceRootElement ( getThisResource ( ) ), crearVentanaSplash ) function crearVentanaLogin ( ) ventanaLogin = guiCreateWindow ( 0.25, 0.25, 0.5, 0.5, "Iniciar Sesion", true ) guiCreateLabel ( 0.07, 0.1, 0.9, 0.1, "Bienvenido, usuario antiguo, Inicia sesion a continuacion.", true, ventanaLogin ) botonLoginx = guiCreateButton ( 0.25, 0.3, 0.5, 0.2, "iniciar sesion >>", true, ventanaLogin ) botonRegistrox = guiCreateButton ( 0.25, 0.55, 0.5, 0.2, "registrarse >>", true, ventanaLogin ) guiSetVisible ( ventanaLogin, true ) guiSetInputEnabled ( true ) end addEvent ( "crearLogin", true ) addEventHandler ( "crearLogin", getLocalPlayer(), crearVentanaLogin ) function pulsarBotonLogin ( boton, estado, absoluteX, absoluteY ) guiSetVisible ( ventanaSplash, false ) crearVentanaLogin ( ) end addEventHandler ( "onClientGUIClick", botonLogin, pulsarBotonLogin, false ) When i click 'botonLogin', it should show me another window, but it does not work. It says there's a f*cked up argument in line 34, but there's nothing wrong with it? May be the fact that GUI in 1.0 is f*cked? You decide, people!
Gamesnert Posted January 9, 2009 Posted January 9, 2009 function crearVentanaSplash ( ) ventanaSplash = guiCreateWindow ( 0.25, 0.25, 0.5, 0.5, "MTA: No More Hope", true ) guiCreateLabel ( 0.07, 0.1, 0.9, 0.1, "Para continuar, inicia tu sesion o bien crea una cuenta nueva.", true, ventanaSplash ) botonLogin = guiCreateButton ( 0.25, 0.3, 0.5, 0.2, "iniciar sesion >>", true, ventanaSplash ) botonRegistro = guiCreateButton ( 0.25, 0.55, 0.5, 0.2, "registrarse >>", true, ventanaSplash ) guiSetVisible ( ventanaSplash, true ) guiSetInputEnabled ( true ) addEventHandler ( "onClientGUIClick", botonLogin, pulsarBotonLogin, false ) end addEvent ( "crearSplash", true ) addEventHandler ( "onClientResourceStart", getResourceRootElement ( getThisResource ( ) ), crearVentanaSplash ) .. function pulsarBotonLogin ( boton, estado, absoluteX, absoluteY ) guiSetVisible ( ventanaSplash, false ) crearVentanaLogin ( ) end No, GUI in 1.0 isn't f*cked as you say. You should start paying more attention to WHERE you place your addEventHandlers. Projects: Slothbot | Maximap
therenex Posted January 9, 2009 Author Posted January 9, 2009 humm... it has to be f*cked (or changed) in some way because not even the example in the wiki worked. Gonna try your code. EDIT: Whoa, it fucking works. I don't know, it used to work before the way I did it. Thanks. I kinda love you. I owe you one.
Gamesnert Posted January 9, 2009 Posted January 9, 2009 humm... it has to be f*cked (or changed) in some way because not even the example in the wiki worked. Gonna try your code.EDIT: Whoa, it works. I don't know, it used to work before the way I did it. Thanks. I kinda love you. I owe you one. That example did show you where to put the addEventHandler, if you payed attention. Projects: Slothbot | Maximap
therenex Posted January 9, 2009 Author Posted January 9, 2009 Of course I payed attention NOW. I made multiple windows and everything's fine.
Lordy Posted January 10, 2009 Posted January 10, 2009 Would be a useful hobby to pay attention before you start complaining about mta to be fucked
therenex Posted January 12, 2009 Author Posted January 12, 2009 lol... i just used that title because makes people pay attention, i got my awnser in about ten minutes, that is what i wanted. Thank you all. I don't think MTA is fucked, i love it, i use it since the old releases in VC.
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