Abbas_gamer100 Posted July 17, 2018 Share Posted July 17, 2018 function createLoginGui () wdwLogin = guiCreateWindow(529, 206, 488, "Login Panel", false) guiWindowSetMovable (wdwLogin, false) guiWindowSetSizable (wdwLogin, false) guiSetAlpha (wdwLogin, 1.00) guiSetProperty (wdwLogin, "CaptionColour", "FFFEFEFE") lblMainLogin = guiCreateLabel (7, 14, 293, 48, "Testing server", true, wdwLogin) guiSetFont (lblMainLogin, "clear-normal") guiLabelSetColor(lblMainLogin, "center", true) guiLabelSetHorizontalAlign (lblMainLogin, "center", true) guiLabelSetVerticalAlign (lblMainLogin, "center", true) guiLabelSetVerticalAlign (lblMainLogin, "center") lblUsernameLogin = guiCreateLabel (11, 77, 124, 24, "Username", true, wdwLogin) edtUsernameLogin = guiCreateEdit (11, 106, 279, 34, "", true, wdwLogin) lblPasswordLogin = guiCreateLabel (16, 147, 128, 24, "Password", true, wdwLogin) edtPasswordLogin = guicreateEdit (11, 171, 279, 34, "", true, wdwLogin) btnLogin = guiCreateButton (10, 308, 114, 34, "Register", true, wdwLogin) guiSetVisible (wdwLogin, false) end addEventHandler ("onClientResourceStart", getRootElement(), function () createLoginGui () outputChatbox ("Welcome to the testing server") if (wdwLogin == nil) then guiSetVisible (wdwLogin, true) else outputChatbox ("Failed to create login panel") end showCursor (true) guiSetInputEnabled (true) end ) I need help concerning my login panel. I scripted it right and according to the MTA website tutorial. But when I join the server it the login panel doesn't show up, and I am left with black screen. The code is up there, something wrong with it? Here's how it's defined in meta.xml: <meta> <info author="Someguy" type="gamemode" name="Testing server" description="A server for testing scripts" /> <script src="client/login_gui.lua" type="client" /> </meta> Link to comment
Erknneto Posted July 17, 2018 Share Posted July 17, 2018 function createLoginGui () wdwLogin = guiCreateWindow(529, 206, 488, "Login Panel", false) guiWindowSetMovable (wdwLogin, false) guiWindowSetSizable (wdwLogin, false) guiSetAlpha (wdwLogin, 1.00) guiSetProperty (wdwLogin, "CaptionColour", "FFFEFEFE") lblMainLogin = guiCreateLabel (7, 14, 293, 48, "Testing server", true, wdwLogin) guiSetFont (lblMainLogin, "clear-normal") guiLabelSetColor(lblMainLogin, "center", true) guiLabelSetHorizontalAlign (lblMainLogin, "center", true) guiLabelSetVerticalAlign (lblMainLogin, "center", true) guiLabelSetVerticalAlign (lblMainLogin, "center") lblUsernameLogin = guiCreateLabel (11, 77, 124, 24, "Username", true, wdwLogin) edtUsernameLogin = guiCreateEdit (11, 106, 279, 34, "", true, wdwLogin) lblPasswordLogin = guiCreateLabel (16, 147, 128, 24, "Password", true, wdwLogin) edtPasswordLogin = guicreateEdit (11, 171, 279, 34, "", true, wdwLogin) btnLogin = guiCreateButton (10, 308, 114, 34, "Register", true, wdwLogin) guiSetVisible (wdwLogin, false) end addEventHandler ("onClientResourceStart", getRootElement(), function () createLoginGui () outputChatbox ("Welcome to the testing server") if (wdwLogin == nil) then guiSetVisible (wdwLogin, true) else outputChatbox ("Failed to create login panel") end showCursor (true) guiSetInputEnabled (true) end ) createLoginGui () --when the client finish the resource download, it will create the login panel Try this. Link to comment
Abbas_gamer100 Posted July 17, 2018 Author Share Posted July 17, 2018 2 hours ago, Erknneto said: function createLoginGui () wdwLogin = guiCreateWindow(529, 206, 488, "Login Panel", false) guiWindowSetMovable (wdwLogin, false) guiWindowSetSizable (wdwLogin, false) guiSetAlpha (wdwLogin, 1.00) guiSetProperty (wdwLogin, "CaptionColour", "FFFEFEFE") lblMainLogin = guiCreateLabel (7, 14, 293, 48, "Testing server", true, wdwLogin) guiSetFont (lblMainLogin, "clear-normal") guiLabelSetColor(lblMainLogin, "center", true) guiLabelSetHorizontalAlign (lblMainLogin, "center", true) guiLabelSetVerticalAlign (lblMainLogin, "center", true) guiLabelSetVerticalAlign (lblMainLogin, "center") lblUsernameLogin = guiCreateLabel (11, 77, 124, 24, "Username", true, wdwLogin) edtUsernameLogin = guiCreateEdit (11, 106, 279, 34, "", true, wdwLogin) lblPasswordLogin = guiCreateLabel (16, 147, 128, 24, "Password", true, wdwLogin) edtPasswordLogin = guicreateEdit (11, 171, 279, 34, "", true, wdwLogin) btnLogin = guiCreateButton (10, 308, 114, 34, "Register", true, wdwLogin) guiSetVisible (wdwLogin, false) end addEventHandler ("onClientResourceStart", getRootElement(), function () createLoginGui () outputChatbox ("Welcome to the testing server") if (wdwLogin == nil) then guiSetVisible (wdwLogin, true) else outputChatbox ("Failed to create login panel") end showCursor (true) guiSetInputEnabled (true) end ) createLoginGui () --when the client finish the resource download, it will create the login panel Try this. It didn't work either. I don't know what's wrong. Link to comment
Erknneto Posted July 17, 2018 Share Posted July 17, 2018 (edited) function createLoginGui () wdwLogin = guiCreateWindow(529, 206, 488, "Login Panel", false) guiWindowSetMovable (wdwLogin, false) guiWindowSetSizable (wdwLogin, false) guiSetAlpha(wdwLogin, 1.00) guiSetProperty(wdwLogin,"CaptionColour","FFFEFEFE") lblMainLogin = guiCreateLabel(7, 14, 293, 48,"Testing server",true,wdwLogin) lblUsernameLogin = guiCreateLabel (11, 77, 124, 24, "Username", true, wdwLogin) edtUsernameLogin = guiCreateEdit (11, 106, 279, 34, "", true, wdwLogin) lblPasswordLogin = guiCreateLabel (16, 147, 128, 24, "Password", true, wdwLogin) edtPasswordLogin = guiCreateEdit (11, 171, 279, 34, "", true, wdwLogin) btnLogin = guiCreateButton (10, 308, 114, 34, "Register", true, wdwLogin) end createLoginGui() Try now. Edited July 17, 2018 by Erknneto Link to comment
DiGiTal Posted July 17, 2018 Share Posted July 17, 2018 (edited) function createLoginGui () wdwLogin = guiCreateWindow(529, 206, 488, "Login Panel", false) guiWindowSetMovable (wdwLogin, false) guiWindowSetSizable (wdwLogin, false) guiSetAlpha (wdwLogin, 1.00) guiSetProperty (wdwLogin, "CaptionColour", "FFFEFEFE") lblMainLogin = guiCreateLabel (7, 14, 293, 48, "Testing server", true, wdwLogin) guiSetFont (lblMainLogin, "clear-normal") guiLabelSetColor(lblMainLogin, "center", true) guiLabelSetHorizontalAlign (lblMainLogin, "center", true) guiLabelSetVerticalAlign (lblMainLogin, "center", true) guiLabelSetVerticalAlign (lblMainLogin, "center") lblUsernameLogin = guiCreateLabel (11, 77, 124, 24, "Username", true, wdwLogin) edtUsernameLogin = guiCreateEdit (11, 106, 279, 34, "", true, wdwLogin) lblPasswordLogin = guiCreateLabel (16, 147, 128, 24, "Password", true, wdwLogin) edtPasswordLogin = guiCreateEdit (11, 171, 279, 34, "", true, wdwLogin) btnLogin = guiCreateButton (10, 308, 114, 34, "Register", true, wdwLogin) guiSetVisible (wdwLogin, true) end function start() createLoginGui() if wdwLogin then outputChatBox("Welcome to the testing server") showCursor (true) guiSetInputEnabled (true) else outputChatBox("Failed to create login panel") showCursor (false) end end addEventHandler ("onClientResourceStart", getRootElement(),start) You should revise wiki functions: outputChatBox not outputChatbox !!!!!! guiCreateEdit not guicreateEdit !!!!!! you should use the syntax https://forum.multitheftauto.com/topic/38240-tut-notepad-auto-complete-amp-syntax-highlighting/ Edited July 17, 2018 by DiGiTal 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