Jump to content

Help with a login problem


Gripe Wolf

Recommended Posts

Hi, I have a problem with a login that I am doing, I followed a tutorial but at the time of executing my script on the server it does not show how it should (the panel does not appear) I resorted to putting a command to execute it. 

function login()
        GUIEditor.staticimage[1] = guiCreateStaticImage(0, 0, 1280, 960, ":loginG/imagenes/ap.png", false)

        GUIEditor.label[1] = guiCreateLabel(400, 410, 96, 15, "USUARIO:", false, GUIEditor.staticimage[1])
        guiSetFont(GUIEditor.label[1], "default-bold-small")
        guiLabelSetColor(GUIEditor.label[1], 245, 225, 8 )
        GUIEditor.edit[1] = guiCreateEdit(459, 410, 429, 33, "", false, GUIEditor.staticimage[1])
        GUIEditor.edit[2] = guiCreateEdit(556, 486, 429, 33, "", false, GUIEditor.staticimage[1])
        GUIEditor.label[2] = guiCreateLabel(496, 486, 96, 15, "CONTRASEÑA:", false, GUIEditor.staticimage[1])
        guiSetFont(GUIEditor.label[2], "default-bold-small")
        guiLabelSetColor(GUIEditor.label[2], 245, 225, 8  )
        GUIEditor.staticimage[2] = guiCreateStaticImage(301, 248, 340, 144, ":loginG/imagenes/log2.png", false, GUIEditor.staticimage[1])
        GUIEditor.button[1] = guiCreateButton(556, 543, 83, 28, "LOGIN", false, GUIEditor.staticimage[1])
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF0AF20F")
        GUIEditor.button[2] = guiCreateButton(898, 543, 83, 28, "REGISTER", false, GUIEditor.staticimage[1])
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFB0000")
        GUIEditor.staticimage[3] = guiCreateStaticImage(53, 18, 55, 59, ":loginG/imagenes/dclog.png", false, GUIEditor.staticimage[1])
        GUIEditor.label[3] = guiCreateLabel(108, 40, 697, 15, "https://discord.gg/dxduys", false, GUIEditor.staticimage[1])
        GUIEditor.staticimage[4] = guiCreateStaticImage(53, 77, 55, 51, ":loginG/imagenes/flog.png", false, GUIEditor.staticimage[1])
        GUIEditor.label[4] = guiCreateLabel(108, 96, 697, 15, "https://www.facebook.com/profile.php?id=100007968251524", false, GUIEditor.staticimage[1])
        GUIEditor.staticimage[5] = guiCreateStaticImage(43, 118, 79, 61, ":loginG/imagenes/ylog.png", false, GUIEditor.staticimage[1])
        GUIEditor.label[5] = guiCreateLabel(118, 142, 697, 15, "https://www.youtube.com/channel/UC1PvXhxIgmXML547WWNur1w?view_as=subscriber", false, GUIEditor.staticimage[1])    
    end
    addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), login )

this is the code tell me how to make it appear please.

Edited by Gripe Wolf
something was missing
Link to comment
5 hours ago, MrTasty said:

¿Está definida la tabla GUIEditor? ¿Están definidas las subtablas GUIEditor.staticimage, GUIEditor.label, GUIEditor.edit y GUIEditor.button? También use etiquetas de código la próxima vez, es el botón <> en la barra de herramientas del editor de texto enriquecido.

Spoiler

function register()
        registerW = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, ":loginG/imagenes/rg.png", true)

        GUIEditor.label[1] = guiCreateLabel(0.38, 0.46, 0.06, 0.03, "USUARIO:", true, registerW)
        guiSetFont(GUIEditor.label[1], "default-bold-small")
        guiLabelSetColor(GUIEditor.label[1], 233, 241, 12)
        GUIEditor.edit[1] = guiCreateEdit(0.43, 0.46, 0.28, 0.03, "", true, registerW)
        GUIEditor.label[2] = guiCreateLabel(0.43, 0.53, 0.06, 0.02, "CONTRASEÑA:", true, registerW)
        guiSetFont(GUIEditor.label[2], "default-bold-small")
        guiLabelSetColor(GUIEditor.label[2], 249, 3, 38)
        GUIEditor.edit[2] = guiCreateEdit(0.49, 0.53, 0.28, 0.03, "", true, registerW)
        GUIEditor.label[3] = guiCreateLabel(0.50, 0.58, 0.06, 0.02, "CONTRASEÑA:", true, registerW)
        guiSetFont(GUIEditor.label[3], "default-bold-small")
        guiLabelSetColor(GUIEditor.label[3], 249, 3, 38)
        GUIEditor.edit[3] = guiCreateEdit(0.56, 0.58, 0.28, 0.03, "", true, registerW)
        GUIEditor.staticimage[2] = guiCreateStaticImage(0.49, 0.30, 0.13, 0.15, ":loginG/imagenes/log1.png", true, registerW)
        registrar1 = guiCreateButton(0.56, 0.63, 0.07, 0.04, "REGISTRAR", true, registerW)
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF14F608")
        regresar = guiCreateButton(0.77, 0.63, 0.07, 0.04, "REGRESAR", true, registerW)
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFE0000")    
    end

function loginf()
        loginW = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, ":loginG/imagenes/ap.png", true)

        GUIEditor.label[1] = guiCreateLabel(0.37, 0.51, 0.05, 0.02, "USUARIO:", true, loginW)
        guiSetFont(GUIEditor.label[1], "default-bold-small")
        guiLabelSetColor(GUIEditor.label[1], 84, 243, 6)
        GUIEditor.edit[1] = guiCreateEdit(0.42, 0.51, 0.28, 0.03, "", true, loginW)
        GUIEditor.label[2] = guiCreateLabel(0.44, 0.58, 0.06, 0.02, "CONTRASEÑA:", true, loginW)
        guiSetFont(GUIEditor.label[2], "default-bold-small")
        guiLabelSetColor(GUIEditor.label[2], 242, 6, 6)
        GUIEditor.edit[2] = guiCreateEdit(0.50, 0.58, 0.28, 0.03, "", true, loginW)
        GUIEditor.staticimage[2] = guiCreateStaticImage(0.29, 0.36, 0.24, 0.13, ":loginG/imagenes/log2.png", true, loginW)
        GUIEditor.staticimage[3] = guiCreateStaticImage(0.01, 0.03, 0.04, 0.06, ":loginG/imagenes/dclog.png", true, loginW)
        GUIEditor.label[3] = guiCreateLabel(0.06, 0.06, 0.38, 0.02, "https://discord.gg/dxduys", true, loginW)
        guiSetFont(GUIEditor.label[3], "default-bold-small")
        guiLabelSetColor(GUIEditor.label[3], 74, 248, 6)
        GUIEditor.staticimage[4] = guiCreateStaticImage(0.04, 0.13, 0.04, 0.05, ":loginG/imagenes/flog.png", true, loginW)
        GUIEditor.label[4] = guiCreateLabel(0.09, 0.14, 0.38, 0.02, "https://www.facebook.com/profile.php?id=100007968251524", true, loginW)
        guiSetFont(GUIEditor.label[4], "default-bold-small")
        guiLabelSetColor(GUIEditor.label[4], 5, 210, 247)
        GUIEditor.staticimage[5] = guiCreateStaticImage(0.02, 0.08, 0.08, 0.06, ":loginG/imagenes/ylog.png", true, loginW)
        GUIEditor.label[5] = guiCreateLabel(0.10, 0.10, 0.46, 0.02, "https://www.youtube.com/channel/UC1PvXhxIgmXML547WWNur1w?view_as=subscriber", true, loginW)
        guiSetFont(GUIEditor.label[5], "default-bold-small")
        guiLabelSetColor(GUIEditor.label[5], 248, 5, 11)
        login = guiCreateButton(0.50, 0.64, 0.06, 0.04, "LOGIN", true, loginW)
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF0AF10A")
        registrar = guiCreateButton(0.71, 0.64, 0.06, 0.04, "REGISTRAR", true, loginW)
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFF80202") 

        showCursor(true)
        addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), loginf )
        addEventHandler("onClientGUIClick",registrar,function()
        guiSetVisible(LoginW,false)
        register()
        end)
        
    end

        addCommandHandler("lo",loginf)
        
        addEvent("abrirlogin"),true)
        addEventHandler("abrirlogin"getlocalPlayer(),login)    

look like this I did not understand much what you told me but if you could explain to me in a simpler way since I am new.

Link to comment

It's likely that the execution of the code is aborted by the Lua interpreter when it wants to store the result of guiCreateStaticImage(0, 0, 1280, 960, ":loginG/imagenes/ap.png", false) into a non-existant table.

You need to add the following before any other code you may have:

local GUIEditor = {}
GUIEditor.staticimage = {}
GUIEditor.label = {}
GUIEditor.edit = {}
GUIEditor.button = {}

-- or (simply a matter of preference)

local GUIEditor = {
  staticimage = {},
  label = {},
  edit = {},
  button = {},
}

 

Edited by MrTasty
  • Like 1
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...