Jump to content

GUI is f*cked


therenex

Recommended Posts

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!

Link to comment
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.

Link to comment
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 :o 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. :roll:

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