Jump to content

Login panel not working (HELP)


Ryan2233

Recommended Posts

Hello everyone, 

I'm a beginner scripter myself, but I've came across a problem so overwhelming for me. 

My friend gave me a login panel, but it's not doing anything, all i've done is add it to the admin acl, maybe i'm missing something? Once username and password is entered, literally, nothing happens. Code concerning the login: 

function loginActions()
if source == button[1] then
local username = guiGetText(edit[1]):lower()
local password = guiGetText(edit[2])
if (username ~= "") and (password ~= "") then
if editModified then
triggerServerEvent("sendLogin", getLocalPlayer(), username, sha256(password))
else
triggerServerEvent("sendLogin", getLocalPlayer(), username, password)
end
else
showLoginError("Please enter your username and password.")
end
elseif source == button[2] then
guiSetVisible(window[1], false)
guiSetVisible(window[2], true)
end
end

 

Link to comment

wtf

20 hours ago, Dimos7 said:

The problem is in triggerServerEvent change getLocalPlayer() to root or resourceRoot 

by the way, you hide window and shot it again at line 15,16

guiSetVisible(window[1], false)
guiSetVisible(window[2], true)

maybe you want this?

guiSetVisible(window[1], false)
showCursor(false)

 

Also, check script for errors (use '/debugscript 3' command)

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