Abbas_gamer100 Posted January 18, 2017 Author Share Posted January 18, 2017 How to make it Client side? Link to comment
TheNormalnij Posted January 18, 2017 Share Posted January 18, 2017 Spoiler Берешь и пишешь, только пример с вики не работает 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
Abbas_gamer100 Posted January 18, 2017 Author Share Posted January 18, 2017 Проблема заключается в том: Я начинающий. Так, я следую за учебники на вики. Link to comment
TheNormalnij Posted January 18, 2017 Share Posted January 18, 2017 (edited) We have russian selection with blackjack and hookers examples and lessons. Learn Lua first. Edit simple scripts, write commands, etc... Edited January 18, 2017 by TheNormalnij Link to comment
Moderators IIYAMA Posted January 18, 2017 Moderators Share Posted January 18, 2017 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
Abbas_gamer100 Posted January 19, 2017 Author Share Posted January 19, 2017 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) Link to comment
Moderators IIYAMA Posted January 19, 2017 Moderators Share Posted January 19, 2017 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
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