Jump to content

Login Panel not detecting Account


Recommended Posts

Spoiler

Берешь и пишешь, только пример с вики не работает :D


 

addEvent("onClientLoginError", true)
addEvent("onClientLogin", true)

function clientSubmitLogin(button, state)
    if button == "left" and state == "up" then 
	    local username = guiGetText(Edit1)
	    local password = guiGetText(Edit2)
	    if username and password then 
	        triggerServerEvent("submitLogin", getRootElement(), username, password)
        else
	        outputChatBox("Please enter a valid username and password.")
	    end
	end 
end 

addEventHandler('onClientLogin', root, function()
	guiSetVisible(LoginPanel, false)
	showCursor(false)
end )

addEventHandler( 'onClientLoginError', root, function()
	-- you must have a text label for errors :/
	
end )

Wiki example does not work property. It is only logic of scripting. Find working login panels in community or edit this code

Link to comment
  • Moderators

How to set a script serverside?

https://wiki.multitheftauto.com/wiki/Meta.xml

Meta.xml

<script src="server.lua" /> <!-- serverside -->
<script src="server.lua" type="server"/> <!-- serverside -->
<script src="client.lua" type="client"/> <!-- clientside -->
 

Serverside:

Code that only runs at the 'server'. (Which can also be on a player his computer, if he is the host)

 

Clientside:

Code that runs on every player his computer.

Link to comment
  • Moderators
8 hours ago, Abbas_gamer100 said:

I placed the code in a clientside file. And identified it as client in meta.xml. But I still get the error message.

Error: attempt to call local getAccount (a nil value)

Which side do you think is more logic to have access accounts? Serverside(the server) or clientside(all players)?

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