Ahmed Abo-elezz Posted November 13, 2014 Share Posted November 13, 2014 please fix this code and show to me what is warring this for whan i put on button i get text in editbox and get login please help client addEventHandler("onClientGUIClick", buttonLogin, clientSubmitLogin, false) function clientSubmitLogin() local username = guiGetText(editUsername) local password = guiGetText(editPassword) if username and password then triggerServerEvent("submitLogin", getRootElement(), localPlayer, username, password) end end end addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) addEvent("hideLoginWindow", true) function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible(window, false) showCursor(false) guiSetVisible ( image, false ) end server function loginHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then (logIn(player, account, password) == true) then triggerClientEvent("registerTaken", getRootElement()) end end addEvent("submitLogin", true) addEventHandler("submitLogin", root, loginHandler) Link to comment
Castillo Posted November 13, 2014 Share Posted November 13, 2014 (logIn(player, account, password) == true) then You forgot the 'if' before logIn. Link to comment
Ahmed Abo-elezz Posted November 13, 2014 Author Share Posted November 13, 2014 not work this all script please help me client local localPlayer = getLocalPlayer() local playerName = getPlayerName(localPlayer) addEventHandler("onClientResourceStart", root, -- onClientPlayerJoin function () outputChatBox ("fewfwefw") GUIEditor = { memo = {}, button = {}, edit = {}, window = {}, label = {}, } GUIEditor.window[1] = guiCreateWindow(0.28, 0.20, 0.50, 0.53, "", true) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.edit[1] = guiCreateEdit(18, 38, 148, 34, "", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(400, 76, 148, 34, "", false, GUIEditor.window[1]) guiEditSetMasked(GUIEditor.edit[2], true) GUIEditor.edit[3] = guiCreateEdit(400, 38, 148, 34, "", false, GUIEditor.window[1]) GUIEditor.edit[4] = guiCreateEdit(18, 76, 148, 34, "", false, GUIEditor.window[1]) guiEditSetMasked(GUIEditor.edit[4], true) GUIEditor.label[1] = guiCreateLabel(176, 48, 138, 29, "اسم المستخدم", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(558, 47, 88, 29, "اسم المستخدم", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(176, 77, 132, 29, "كلمة المرور", false, GUIEditor.window[1]) GUIEditor.label[4] = guiCreateLabel(558, 76, 88, 29, "كلمة المرور", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(451, 115, 97, 34, "تسجيل الدخول", false, GUIEditor.window[1]) buttonLogin = guiCreateButton(94, 116, 72, 34, "تسجيل", false, GUIEditor.window[1]) GUIEditor.memo[2] = guiCreateMemo(10, 159, 660, 240, "", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[2], true) showCursor ( true ) end ) addEventHandler("onClientGUIClick", buttonLogin, clientSubmitLogin, false) function clientSubmitLogin() local username = guiGetText(editUsername) local password = guiGetText(editPassword) if username and password then triggerServerEvent("submitLogin", getRootElement(), localPlayer, username, password) end end addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) addEvent("hideLoginWindow", true) function hideLoginWindow() outputChatBox ("sdgsrgrrrrrrr") end server function loginHandler(player, username, password) local account = getAccount(username, password) if (logIn(player, account, password) == true) then triggerClientEvent("hideLoginWindow", getRootElement()) else outputChatBox ("fghfrthrhr111") end end addEvent("submitLogin", true) addEventHandler("submitLogin", root, loginHandler) Link to comment
Castillo Posted November 13, 2014 Share Posted November 13, 2014 Do you get any error in the debugscript? Link to comment
Ahmed Abo-elezz Posted November 13, 2014 Author Share Posted November 13, 2014 no - - - Link to comment
TAPL Posted November 13, 2014 Share Posted November 13, 2014 You're attaching the events to function that not been created yet. 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