Jump to content

CRoW,,#

Members
  • Posts

    646
  • Joined

  • Last visited

Everything posted by CRoW,,#

  1. بالتوفيق #ما تشوف شر
  2. اي واحد من العيال يساعدني
  3. ما اشتغل function centerWindow( center_window ) local screenW, screenH = guiGetScreenSize( ); local windowW, windowH = guiGetSize( center_window, false ); local x, y = ( screenW - windowW ) / 2, ( screenH - windowH ) / 2; guiSetPosition( center_window, x, y, false ); end GUIEditor_Button = {} GUIEditor_Checkbox = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Image = {} wnd = guiCreateWindow(1,1,799,599,"",false) guiSetAlpha(wnd,1) GUIEditor_Image[1] = guiCreateStaticImage(10,25,780,438,"1.png",false,wnd) GUIEditor_Button[1] = guiCreateButton(248,564,94,26,"login",false,wnd) GUIEditor_Button[2] = guiCreateButton(420,565,94,24,"register",false,wnd) GUIEditor_Checkbox[1] = guiCreateCheckBox(438,525,25,38,"",false,false,wnd) guiCheckBoxSetSelected(GUIEditor_Checkbox[1],true) GUIEditor_Label[1] = guiCreateLabel(463,532,142,19,"حفظ كلمة المرور",false,wnd) GUIEditor_Edit[1] = guiCreateEdit(306,468,169,23,"",false,wnd) GUIEditor_Edit[2] = guiCreateEdit(306,501,169,23,"",false,wnd) GUIEditor_Label[2] = guiCreateLabel(243,469,110,21,"username",false,wnd) GUIEditor_Label[3] = guiCreateLabel(243,502,110,21,"password",false,wnd) ss = guiCreateStaticImage(1,1,799,599,"images/صوره.png",false) guiSetVisible(wnd,false) addEventHandler("onClientResourceStart", root, function() guiSetVisible(wnd, true) showCursor(true) end) addEventHandler ("onClientGUIClick", root, function ( ) if ( source == GUIEditor.button[1] ) then triggerServerEvent("login", localPlayer, localPlayer, guiGetText ( GUIEditor.edit[1] ), guiGetText ( GUIEditor.edit[2] ) ) elseif ( source == GUIEditor.button[2] ) then triggerServerEvent("register", localPlayer, localPlayer, guiGetText ( GUIEditor.edit[1] ), guiGetText ( GUIEditor.edit[2] ) ) end end ) local username, password = loadLoginFromXML() if not( username == "" or password == "") then guiCheckBoxSetSelected ( GUIEditor_Checkbox[1], true ) guiSetText ( GUIEditor_Button[1], tostring(username)) guiSetText ( GUIEditor_Button[2], tostring(password)) else guiCheckBoxSetSelected ( GUIEditor_Checkbox[1], false ) guiSetText ( GUIEditor_Button[1], tostring(username)) guiSetText ( GUIEditor_Button[2], tostring(password)) end function saveLoginToXML(username, password) local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end xmlNodeSetValue (usernameNode, tostring(username)) end if (password ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, tostring(password)) end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File) end addEvent("saveLoginToXML", true) addEventHandler("saveLoginToXML", getRootElement(), saveLoginToXML) function resetSaveXML() local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end
  4. الكود النهائي function centerWindow( center_window ) local screenW, screenH = guiGetScreenSize( ); local windowW, windowH = guiGetSize( center_window, false ); local x, y = ( screenW - windowW ) / 2, ( screenH - windowH ) / 2; guiSetPosition( center_window, x, y, false ); end GUIEditor_Button = {} GUIEditor_Checkbox = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Image = {} wnd = guiCreateWindow(1,1,799,599,"",false) guiSetAlpha(wnd,1) GUIEditor_Image[1] = guiCreateStaticImage(10,25,780,438,"images/tarkep.png",false,wnd) GUIEditor_Button[1] = guiCreateButton(248,564,94,26,"login",false,wnd) GUIEditor_Button[2] = guiCreateButton(420,565,94,24,"register",false,wnd) GUIEditor_Checkbox[1] = guiCreateCheckBox(438,525,25,38,"",false,false,wnd) guiCheckBoxSetSelected(GUIEditor_Checkbox[1],true) GUIEditor_Label[1] = guiCreateLabel(463,532,142,19,"حفظ كلمة المرور",false,wnd) GUIEditor_Edit[1] = guiCreateEdit(306,468,169,23,"",false,wnd) GUIEditor_Edit[2] = guiCreateEdit(306,501,169,23,"",false,wnd) GUIEditor_Label[2] = guiCreateLabel(243,469,110,21,"username",false,wnd) GUIEditor_Label[3] = guiCreateLabel(243,502,110,21,"password",false,wnd) ss = guiCreateStaticImage(1,1,799,599,"images/صوره.png",false) guiSetVisible(wnd,false) addEventHandler("onClientResourceStart", root, function() guiSetVisible(wnd, true) showCursor(true) end) addEventHandler ("onClientGUIClick", root, function ( ) if ( source == GUIEditor.button[1] ) then triggerServerEvent("login", localPlayer, localPlayer, guiGetText ( GUIEditor.edit[1] ), guiGetText ( GUIEditor.edit[2] ) ) elseif ( source == GUIEditor.button[2] ) then triggerServerEvent("register", localPlayer, localPlayer, guiGetText ( GUIEditor.edit[1] ), guiGetText ( GUIEditor.edit[2] ) ) end end ) local username, password = loadLoginFromXML() if not( username == "" or password == "") then guiCheckBoxSetSelected ( GUIEditor_Checkbox[1], true ) guiSetText ( GUIEditor_Button[1], tostring(username)) guiSetText ( GUIEditor_Button[2], tostring(password)) else guiCheckBoxSetSelected ( GUIEditor_Checkbox[1], false ) guiSetText ( GUIEditor_Button[1], tostring(username)) guiSetText ( GUIEditor_Button[2], tostring(password)) end end end function saveLoginToXML(username, password) local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end xmlNodeSetValue (usernameNode, tostring(username)) end if (password ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, tostring(password)) end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File) end addEvent("saveLoginToXML", true) addEventHandler("saveLoginToXML", getRootElement(), saveLoginToXML) function resetSaveXML() local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end end if (password ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, "") end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File) end addEvent("resetSaveXML", true) addEventHandler("resetSaveXML", getRootElement(), resetSaveXML) if(button == "left" and state == "up") then if (source == shLogin) then username = guiGetText(GUIEditor_Edit[1]) password = guiGetText(GUIEditor_Edit[2]) if guiCheckBoxGetSelected ( GUIEditor_Checkbox[1] ) == true then checksave = true else checksave = false end triggerServerEvent("onRequestLogin",getLocalPlayer(),username,password,checksave) end end end addEvent ( "HideTheWindow", true ) addEventHandler ( "HideTheWindow", root, function ( ) guiSetVisible ( wnd, false ) fadeCamera ( true ) showCursor ( false ) end ) سويت له حفظ بيانات اذا فيه خطا الرجاء التصحيح والعفو ذذ
  5. !..الرجاء اغلاق الموضوع
  6. لا مو لازم sql +حصلت الككود حق الحفظ
  7. CRoW,,#

    end)

    عملية ولادة مثلا
  8. local username, password = loadLoginFromXML() if not( username == "" or password == "") then guiCheckBoxSetSelected ( checkbox_save, true ) guiSetText ( edit_Login, tostring(username)) guiSetText ( edit_password, tostring(password)) else guiCheckBoxSetSelected ( GUIEditor_Checkbox[1], false ) guiSetText ( GUIEditor_Button[1], tostring(username)) guiSetText ( GUIEditor_Button[2], tostring(password)) end end "" pass="" save="false"> ذا ميتا اذا في خطا صححوه لاهنتم
  9. تضغط على CheckBox وتنحفظ البيانات اذا دخلت مرة ثانية تحصل الحساب+الباس موجودين يعني تضغط login وتدخل
  10. طيب ابي الكود الي يحفظ الباس +الحساب وابي اربطه بالCheckBox
  11. function centerWindow( center_window ) local screenW, screenH = guiGetScreenSize( ); local windowW, windowH = guiGetSize( center_window, false ); local x, y = ( screenW - windowW ) / 2, ( screenH - windowH ) / 2; guiSetPosition( center_window, x, y, false ); end GUIEditor_Button = {} GUIEditor_Checkbox = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Image = {} wnd = guiCreateWindow(1,1,799,599,"",false) guiSetAlpha(wnd,1) GUIEditor_Image[1] = guiCreateStaticImage(10,25,780,438,"images/tarkep.png",false,wnd) GUIEditor_Button[1] = guiCreateButton(248,564,94,26,"login",false,wnd) GUIEditor_Button[2] = guiCreateButton(420,565,94,24,"register",false,wnd) GUIEditor_Checkbox[1] = guiCreateCheckBox(438,525,25,38,"",false,false,wnd) guiCheckBoxSetSelected(GUIEditor_Checkbox[1],true) GUIEditor_Label[1] = guiCreateLabel(463,532,142,19,"حفظ كلمة المرور",false,wnd) GUIEditor_Edit[1] = guiCreateEdit(306,468,169,23,"",false,wnd) GUIEditor_Edit[2] = guiCreateEdit(306,501,169,23,"",false,wnd) GUIEditor_Label[2] = guiCreateLabel(243,469,110,21,"username",false,wnd) GUIEditor_Label[3] = guiCreateLabel(243,502,110,21,"password",false,wnd) ss = guiCreateStaticImage(1,1,799,599,"images/صوره.png",false) guiSetVisible(wnd,false) addEventHandler("onClientResourceStart", root, function() guiSetVisible(wnd, true) showCursor(true) end) addEventHandler("onClientGUIClick",root, function () local user = guiGetText(GUIEditor.edit[1]) local pass = guiGetText(GUIEditor.edit[2]) if ( source == GUIEditor_Button[1] ) then if string.len(user) > 0 and string.len(pass) > 0 then triggerServerEvent("onLogin",localPlayer,user,pass) end elseif ( source == GUIEditor_Button[2] ) then if string.len(user) > 0 and string.len(pass) > 0 then triggerServerEvent("onRegister",localPlayer,user,pass) end end end كذا ؟
  12. وش استخدم عشان اسوي لوحة تسجيل دخول
  13. يعني احط صورة فوقها صورة ؟ وذولي الي فوق خرابيط ومدري ايش وجرب ذا ذذ
  14. ابيه لوحة تسجيل يعني ما ابغاه بزر يعني يخش تفتح له
  15. استخدمت ? bindKey لا ما اضفت لها امر فتح بس شفتها من guieditor ما يطلع شي
  16. wnd = guiCreateWindow(1,1,799,599,"",false) guiSetAlpha(wnd,0) GUIEditor_Image[1] = guiCreateStaticImage(10,25,780,438,"images/tarkep.png",false,wnd) GUIEditor_Button[1] = guiCreateButton(248,564,94,26,"login",false,wnd) GUIEditor_Button[2] = guiCreateButton(420,565,94,24,"register",false,wnd) GUIEditor_Checkbox[1] = guiCreateCheckBox(438,525,25,38,"",false,false,wnd) guiCheckBoxSetSelected(GUIEditor_Checkbox[1],true) GUIEditor_Label[1] = guiCreateLabel(463,532,142,19,"حفظ كلمة المرور",false,wnd) GUIEditor_Edit[1] = guiCreateEdit(306,468,169,23,"",false,wnd) GUIEditor_Edit[2] = guiCreateEdit(306,501,169,23,"",false,wnd) GUIEditor_Label[2] = guiCreateLabel(243,469,110,21,"username",false,wnd) GUIEditor_Label[3] = guiCreateLabel(243,502,110,21,"password",false,wnd)
  17. اذا استخدمت ذا الكود كل شي م يظهر
  18. السلام عليكم ابغا سويت لوحة م تظهر اللوحة بس تظهر االصور والزر اقرب مثال لوحة تسجيل طارة+وزارة
  19. تقدر تلعب بعد ماتسجل دخول يصير لك spawn واذا تبيه يطلع شاشه ويكون في لعب عادي قبل التسجيل كلمني ايه ابغاه لعب عادي لاني اشوف الشاشة السودة تطير الاعبين
×
×
  • Create New...