Mefisto_PL Posted February 3, 2013 Share Posted February 3, 2013 Hi ! My problem is when resource start then cursor isn't showed.. Why? :C addEventHandler ( "onClientResourceStart", getResourceRootElement ( getThisResource ( ) ), function () creatingLoginWindow ( ) outputChatBox ( "Welcome to My MTA:SA Server, please log in." ) if ( modernWNDLogin ~= nil ) then guiSetVisible ( modernWNDLogin, true ) showCursor ( true ) else outputChatBox ( "An unexpected error has occurred and the log in GUI has not been created." ) end guiSetInputEnabled ( true ) end ) Link to comment
Puma Posted February 3, 2013 Share Posted February 3, 2013 if ( modernWNDLogin ~= nil ) then That's just plain stupid. Try this instead: if modernWNDLogin then Link to comment
Mefisto_PL Posted February 4, 2013 Author Share Posted February 4, 2013 I get it from wiki Doesn't work.. :C addEventHandler ( "onClientResourceStart", getResourceRootElement ( getThisResource ( ) ), function () creatingLoginWindow ( ) outputChatBox ( "Welcome to My MTA:SA Server, please log in." ) if modernWNDLogin then guiSetVisible ( modernWNDLogin, true ) showCursor ( true ) else outputChatBox ( "An unexpected error has occurred and the log in GUI has not been created." ) end guiSetInputEnabled ( true ) end ) Link to comment
Puma Posted February 4, 2013 Share Posted February 4, 2013 Could you show the creatingLoginWindow function? Link to comment
Mefisto_PL Posted February 4, 2013 Author Share Posted February 4, 2013 function creatingLoginWindow () local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 modernWNDLogin = guiCreateWindow ( X, Y, Width, Height, "Welcome To Modern Freeroam !", true ) X = 0.0825 Y = 0.23 Width = 0.25 Height = 0.25 guiCreateLabel ( X, Y, Width, Height, "Username", true, modernWNDLogin ) Y = 0.53 guiCreateLabel ( X, Y, Width, Height, "Password", true, modernWNDLogin ) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 editUsername = guiCreateEdit ( X, Y, Width, Height, "", true, modernWNDLogin ) Y = 0.5 editPassword = guiCreateEdit ( X, Y, Width, Height, "", true, modernWNDLogin ) guiEditSetMaxLength ( editUsername, 50 ) guiEditSetMaxLength ( editPassword, 50 ) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 loginBtn = guiCreateButton ( X, Y, Width, Height, "Log In", true, modernWNDLogin ) guiSetVisible ( modernWNDLogin, false ) end addEventHandler ( "onClientResourceStart", getResourceRootElement ( getThisResource ( ) ), function () creatingLoginWindow ( ) outputChatBox ( "Welcome to My MTA:SA Server, please log in." ) if modernWNDLogin then guiSetVisible ( modernWNDLogin, true ) showCursor ( true ) else outputChatBox ( "An unexpected error has occurred and the log in GUI has not been created." ) end guiSetInputEnabled ( true ) end ) Link to comment
Castillo Posted February 4, 2013 Share Posted February 4, 2013 function creatingLoginWindow ( ) local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 modernWNDLogin = guiCreateWindow ( X, Y, Width, Height, "Welcome To Modern Freeroam !", true ) X = 0.0825 Y = 0.23 Width = 0.25 Height = 0.25 guiCreateLabel ( X, Y, Width, Height, "Username", true, modernWNDLogin ) Y = 0.53 guiCreateLabel ( X, Y, Width, Height, "Password", true, modernWNDLogin ) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 editUsername = guiCreateEdit ( X, Y, Width, Height, "", true, modernWNDLogin ) Y = 0.5 editPassword = guiCreateEdit ( X, Y, Width, Height, "", true, modernWNDLogin ) guiEditSetMaxLength ( editUsername, 50 ) guiEditSetMaxLength ( editPassword, 50 ) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 loginBtn = guiCreateButton ( X, Y, Width, Height, "Log In", true, modernWNDLogin ) showCursor ( true ) guiSetInputEnabled ( true ) end addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) creatingLoginWindow ( ) outputChatBox ( "Welcome to My MTA:SA Server, please log in." ) end ) Link to comment
Mefisto_PL Posted February 5, 2013 Author Share Posted February 5, 2013 Not working :C Link to comment
gokalpfirat Posted February 5, 2013 Share Posted February 5, 2013 It works perfectly I try I dont understand what do you want a login system? Login systems gui is nice when I start it gives your gui and cursor. 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