iiv03 Posted August 11, 2018 Share Posted August 11, 2018 hello i build a login panel and i have a big problem anyone fixit this : Client : GUIEditor = { tab = {}, staticimage = {}, tabpanel = {}, edit = {}, button = {}, window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(0.11, 0.08, 0.77, 0.85, "لوحة التسجيل", true) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.73) GUIEditor.memo[1] = guiCreateMemo(0.05, 0.63, 0.18, 0.14, ".\n.\n.\n.\n.\n.\n.\n.\n.\n.\n.\n.\n", true, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) GUIEditor.staticimage[1] = guiCreateStaticImage(0.04, 0.32, 0.21, 0.24, ":guieditor/images/examples/mtalogo.png", true, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) GUIEditor.edit[1] = guiCreateEdit(0.42, 0.38, 0.46, 0.06, "", true, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(0.42, 0.54, 0.46, 0.06, "", true, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(369, 520, 188, 53, "Login", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(716, 520, 188, 53, "Register", false, GUIEditor.window[1]) end ) local screenW, screenH = guiGetScreenSize ( ) addEventHandler("onClientRender", root, function() local playerX, playerY, playerZ = getElementPosition ( localPlayer ) local playerX, playerY, playerZ = getElementPosition ( localPlayer ) local playerZoneName = getZoneName ( playerX, playerY, playerZ ) dxDrawRectangle(147, 54, 986, 50, tocolor(101, 101, 101, 255), true) dxDrawText("لوحة التسجيل", (screenW * 0.1133) - 1, (screenH * 0.0750) - 1, (screenW * 0.8852) - 1, (screenH * 0.1444) - 1, tocolor(0, 0, 0, 255), 1.00, myFont, "center", "center", false, false, true, false, false) dxDrawText("لوحة التسجيل", (screenW * 0.1133) + 1, (screenH * 0.0750) - 1, (screenW * 0.8852) + 1, (screenH * 0.1444) - 1, tocolor(0, 0, 0, 255), 1.00, myFont, "center", "center", false, false, true, false, false) dxDrawText("لوحة التسجيل", (screenW * 0.1133) - 1, (screenH * 0.0750) + 1, (screenW * 0.8852) - 1, (screenH * 0.1444) + 1, tocolor(0, 0, 0, 255), 1.00, myFont, "center", "center", false, false, true, false, false) dxDrawText("لوحة التسجيل", (screenW * 0.1133) + 1, (screenH * 0.0750) + 1, (screenW * 0.8852) + 1, (screenH * 0.1444) + 1, tocolor(0, 0, 0, 255), 1.00, myFont, "center", "center", false, false, true, false, false) dxDrawText("لوحة التسجيل", screenW * 0.1133, screenH * 0.0750, screenW * 0.8852, screenH * 0.1444, tocolor(255, 255, 255, 255), 1.00, myFont, "center", "center", false, false, true, false, false) dxDrawRectangle(screenW * 0.3977, screenH * 0.7958, screenW * 0.1563, screenH * 0.0750, tocolor(84, 84, 84, 254), true) dxDrawRectangle(screenW * 0.6695, screenH * 0.7958, screenW * 0.1563, screenH * 0.0750, tocolor(84, 84, 84, 254), true) dxDrawText("دخول", screenW * 0.3977, screenH * 0.7958, screenW * 0.5539, screenH * 0.8708, tocolor(255, 255, 255, 255), 1.00, myFont, "center", "center", false, false, true, false, false) dxDrawText("انشاء حساب", screenW * 0.6695, screenH * 0.7958, screenW * 0.8258, screenH * 0.8708, tocolor(255, 255, 255, 255), 1.00, "center", "center", false, false, true, false, false) dxDrawText("حقوق طبع والنشر - فنون الريس © 2018", screenW * 0.7695, screenH * 0.9042, screenW * 0.8852, screenH * 0.9250, tocolor(255, 255, 255, 255), 1.00, myFont, "left", "top", false, false, true, false, false) end function HandleTheRendering ( ) addEventHandler ( "onClientRender", root, createText ) -- keep the text visible with onClientRender. end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering ) -- Use 'toggle' command to switch custom font on and off addCommandHandler( "toggle", function() if not myFont then myFont = dxCreateFont( "hacen-liner-print-out-light.ttf", 45 ) -- Create custom font myFont = dxCreateFont( "hacen-liner-print-out-light.ttf", 30 ) myFont = dxCreateFont( "hacen-liner-print-out-light.ttf", 9 ) local myFont = dxCreateFont("hacen-liner-print-out-light.ttf", 45) local myFont = dxCreateFont("hacen-liner-print-out-light.ttf", 30) local myFont = dxCreateFont("hacen-liner-print-out-light.ttf", 9) local screenW, screenH = guiGetScreenSize() else destroyElement( myFont ) -- Destroy custom font myFont = nil end end ) Server : addEvent("onlogin",true) addEventHandler("onlogin",getRootElement(), function (user,pass) local account = getAccount(user,pass) if ( account ) then logIn(source,account,pass) triggerClientEvent(source,"setcol",source) else outputChatBox("* Worng Username Or Password",source,255,0,0) end end ) addEvent("onre",true) addEventHandler("onre",getRootElement(), function (user,pass) local account = getAccount(user,pass) if ( account ) then outputChatBox("* This Account is Already Used",source,255,0,0) else addAccount(user,pass) outputChatBox("UserName: " .. user .. " PassWord : " .. pass,source,0,150,255) end end ) Link to comment
iiv03 Posted August 11, 2018 Author Share Posted August 11, 2018 3 hours ago, Viudes said: so what is the problem..? i start debugscript 3 and i get thes when i start the mode ERROR: Loading script failed: 1xLogin/client.lua:58:')' exepted (to close '(' at line 40) near 'function' Link to comment
LilDawage Posted August 11, 2018 Share Posted August 11, 2018 GUIEditor = { tab = {}, staticimage = {}, tabpanel = {}, edit = {}, button = {}, window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(0.11, 0.08, 0.77, 0.85, "لوحة التسجيل", true) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.73) GUIEditor.memo[1] = guiCreateMemo(0.05, 0.63, 0.18, 0.14, ".\n.\n.\n.\n.\n.\n.\n.\n.\n.\n.\n.\n", true, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) GUIEditor.staticimage[1] = guiCreateStaticImage(0.04, 0.32, 0.21, 0.24, ":guieditor/images/examples/mtalogo.png", true, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) GUIEditor.edit[1] = guiCreateEdit(0.42, 0.38, 0.46, 0.06, "", true, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(0.42, 0.54, 0.46, 0.06, "", true, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(369, 520, 188, 53, "Login", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(716, 520, 188, 53, "Register", false, GUIEditor.window[1]) end ) local screenW, screenH = guiGetScreenSize ( ) addEventHandler("onClientRender", root, function() local playerX, playerY, playerZ = getElementPosition ( localPlayer ) local playerX, playerY, playerZ = getElementPosition ( localPlayer ) local playerZoneName = getZoneName ( playerX, playerY, playerZ ) dxDrawRectangle(147, 54, 986, 50, tocolor(101, 101, 101, 255), true) dxDrawText("لوحة التسجيل", (screenW * 0.1133) - 1, (screenH * 0.0750) - 1, (screenW * 0.8852) - 1, (screenH * 0.1444) - 1, tocolor(0, 0, 0, 255), 1.00, myFont, "center", "center", false, false, true, false, false) dxDrawText("لوحة التسجيل", (screenW * 0.1133) + 1, (screenH * 0.0750) - 1, (screenW * 0.8852) + 1, (screenH * 0.1444) - 1, tocolor(0, 0, 0, 255), 1.00, myFont, "center", "center", false, false, true, false, false) dxDrawText("لوحة التسجيل", (screenW * 0.1133) - 1, (screenH * 0.0750) + 1, (screenW * 0.8852) - 1, (screenH * 0.1444) + 1, tocolor(0, 0, 0, 255), 1.00, myFont, "center", "center", false, false, true, false, false) dxDrawText("لوحة التسجيل", (screenW * 0.1133) + 1, (screenH * 0.0750) + 1, (screenW * 0.8852) + 1, (screenH * 0.1444) + 1, tocolor(0, 0, 0, 255), 1.00, myFont, "center", "center", false, false, true, false, false) dxDrawText("لوحة التسجيل", screenW * 0.1133, screenH * 0.0750, screenW * 0.8852, screenH * 0.1444, tocolor(255, 255, 255, 255), 1.00, myFont, "center", "center", false, false, true, false, false) dxDrawRectangle(screenW * 0.3977, screenH * 0.7958, screenW * 0.1563, screenH * 0.0750, tocolor(84, 84, 84, 254), true) dxDrawRectangle(screenW * 0.6695, screenH * 0.7958, screenW * 0.1563, screenH * 0.0750, tocolor(84, 84, 84, 254), true) dxDrawText("دخول", screenW * 0.3977, screenH * 0.7958, screenW * 0.5539, screenH * 0.8708, tocolor(255, 255, 255, 255), 1.00, myFont, "center", "center", false, false, true, false, false) dxDrawText("انشاء حساب", screenW * 0.6695, screenH * 0.7958, screenW * 0.8258, screenH * 0.8708, tocolor(255, 255, 255, 255), 1.00, "center", "center", false, false, true, false, false) dxDrawText("حقوق طبع والنشر - فنون الريس © 2018", screenW * 0.7695, screenH * 0.9042, screenW * 0.8852, screenH * 0.9250, tocolor(255, 255, 255, 255), 1.00, myFont, "left", "top", false, false, true, false, false) end ) function HandleTheRendering ( ) addEventHandler ( "onClientRender", root, createText ) -- keep the text visible with onClientRender. end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering ) -- Use 'toggle' command to switch custom font on and off addCommandHandler( "toggle", function() if not myFont then myFont = dxCreateFont( "hacen-liner-print-out-light.ttf", 45 ) -- Create custom font myFont = dxCreateFont( "hacen-liner-print-out-light.ttf", 30 ) myFont = dxCreateFont( "hacen-liner-print-out-light.ttf", 9 ) local myFont = dxCreateFont("hacen-liner-print-out-light.ttf", 45) local myFont = dxCreateFont("hacen-liner-print-out-light.ttf", 30) local myFont = dxCreateFont("hacen-liner-print-out-light.ttf", 9) local screenW, screenH = guiGetScreenSize() else destroyElement( myFont ) -- Destroy custom font myFont = nil end end ) 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