nony Posted July 19, 2012 Posted July 19, 2012 ابي كود التسجيل وتسجيل الدخول الي في الشوب لا تبخلون علينا
3NAD Posted July 19, 2012 Posted July 19, 2012 https://wiki.multitheftauto.com/wiki/LogIn https://wiki.multitheftauto.com/wiki/AddAccount
nony Posted July 20, 2012 Author Posted July 20, 2012 اخوي عناد والله مافهمت شي من الروابط الي حطيتها تكفا اذا ماعليك امر اشرحلي انت انا الحمد لله سويت الشوب كامل مابقي الا التسجيل وتسجيل الدخول وارسال الفلوس انا مابي الا التسجيل وخلاص ماتقصر
3NAD Posted July 20, 2012 Posted July 20, 2012 (edited) -- Client Side addEventHandler("onClientGUIClick",getRootElement(), function() if ( source == login/registerBTN) then triggerServerEvent("onLoginAndRegister",getRootElement(),getLocalPlayer(),guiGetText(user), guiGetText(pass)) end) --[[ login/registerBTN = زر التسجيل + الدخول في وظظيفة وحدة يعني يكفي زر واححد user = خآنة اليوزر نيم pass = خانة الباس ورد ]] -- Server Side function LoginAndRegister ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then else outputChatBox ( "* Login Error !", player, 255, 0, 0 ) end else account = addAccount ( user, pass ) if (logIn ( player, account, pass ) == true) then outputChatBox ( "Register Details : [ Username ] : #00FF00" .. user .. " #FFFF1A[ Password ] : #00FF00" .. pass .. "", player, 255, 255, 0 , true ) else outputChatBox ( "Register Error!", player, 255, 255, 0 ) end end end addEvent( "onLoginAndRegister", true ) addEventHandler( "onLoginAndRegister", getRootElement(), LoginAndRegister ) إذا فيه أخخططآء تفضضل و قول بأي سسطر Edited July 20, 2012 by Guest
hassan.k.s.a Posted July 20, 2012 Posted July 20, 2012 --server side-- function on4XLogin ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if ( not isGuestAccount ( account ) ) then -- For every player that's logged in.... logOut ( player ) -- Log them out. end if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else outputChatBox ( "Wrong username or password!", player, 255, 255, 0 ) -- Output they got the details wrong. end end addEvent( "on4XLogin", true ) addEventHandler( "on4XLogin", getRootElement(), on4XLogin ) function on4XRegister ( player, user, pass, name ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else account = addAccount ( user, pass ) setAccountData ( account, "name", name) if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "hideLoginWindow", getRootElement()) else outputChatBox ( "Register/Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end end end addEvent( "on4XRegister", true ) addEventHandler( "on4XRegister", getRootElement(), on4XRegister ) function needVars() local allow_register = get("allow_register") local name_on_register = get("name_on_register") triggerClientEvent(source, "onSendVars", getRootElement(), allow_register, name_on_register) end addEvent("onNeedVars", true) addEventHandler("onNeedVars", getRootElement(), needVars) لما تحط ألأكواد راح تلاقي 3 اسطر الاول الاسم الثاني الباس الثالث الاسم مره ثانيه بنسبه لزر يقبل التسجيل وتسجيل الدخول ---client side--- LblRegisterUsername = guiCreateLabel(10,4,150,16,"Username:",false,tab5)--غير التاب لكل الأسطر EditRegisterUsername = guiCreateEdit(46,22,171,21,"",false,tab5) LblRegisterPassword = guiCreateLabel(10,44,150,16,"Password:",false,tab5) EditRegisterPassword = guiCreateEdit(46,61,171,21,"",false,tab5) guiEditSetMasked(EditRegisterPassword,true) LblRegisterName = guiCreateLabel(10,83,150,16,"agin Name:",false,tab5) EditRegisterName = guiCreateEdit(46,100,171,21,"",false,tab5) BtnAction = guiCreateButton(0,180,260,25,"Login/Register",false,tab5) --ربط الأزرار-- local localPlayer = getLocalPlayer() function receiveVars( allow, name) local playername = getPlayerName(localPlayer) guiSetText(LoginUsername, "") guiSetText(EditRegisterUsername, "") if (name == "false") then guiSetVisible(LblRegisterName, false) guiSetVisible(EditRegisterName, false) end if (allow == "false") then guiDeleteTab(TabRegister, TabPanel) end guiSetSelectedTab(TabPanel, TabLogin) guiSetText(LoginUsername, playername) guiSetText(EditRegisterUsername, playername) guiSetVisible(LoginWin, true) guiBringToFront(LoginWin) guiSetInputEnabled(true) showCursor(true) end addEvent( "onSendVars", true ) addEventHandler( "onSendVars", getRootElement(), receiveVars ) function windowHandler() triggerServerEvent("onNeedVars", getLocalPlayer()) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler) function onClickBtn(button, state) if(button == "left" and state == "up") then if(source == BtnAction) then if(guiGetSelectedTab(TabPanel) == TabLogin) then triggerServerEvent("on4XLogin", getRootElement(), localPlayer, guiGetText(LoginUsername), guiGetText(LoginPassword)) else triggerServerEvent("on4XRegister", getRootElement(), localPlayer, guiGetText(EditRegisterUsername), guiGetText(EditRegisterPassword), guiGetText(EditRegisterName)) end end end end function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible(LoginWin, false) end addEvent("hideLoginWindow", true) addEventHandler("onClientGUIClick", BtnAction, onClickBtn, false) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow)
nony Posted July 21, 2012 Author Posted July 21, 2012 اخوي حسون انت جربته؟ انا يوم اجي اسجل مايسجل يسلموووووو عناد + حسون
Tete omar Posted July 22, 2012 Posted July 22, 2012 لازم تعتمد على نفسك لا تعتمد على الآخرين عشان الآخرين ماراح يلبون لك طلبك كل شوية
nony Posted July 22, 2012 Author Posted July 22, 2012 والله شوف انا ماسويت موضوع من قبل ومسوي الشوب كامل الحمد لله بس باقيلي كود التسجيل وتسجيل الدخول كود ارسال الفلوس الحمد لله خلصته باقيلي ذا الكود تكفون مساعدتكم
nony Posted July 24, 2012 Author Posted July 24, 2012 اخوي حسون الكود الي حطيته فيه خلل يعني اذا واحد دخل السيرفر يجيه سهم مايروح الا اذا دخل اف2 وخرج يروح ممكن تعدل عليه لاهنت؟
TAPL Posted July 24, 2012 Posted July 24, 2012 أحذف سطر 42 و أحتمال تحتاج تحذف كمان الي في سطر 41 في الكلينت
hassan.k.s.a Posted July 24, 2012 Posted July 24, 2012 يب الي قبل فيه عطل جرب ذا تابين --client side-- ----------------------------------------------- tab5 = guiCreateTab("Login",tabPanel) ------------------------------------------------ LoginUsername = guiCreateEdit(0.298,0.1701,0.6157,0.1026,"",true,tab5) guiSetAlpha(LoginUsername,1) LoginPassword = guiCreateEdit(0.298,0.2815,0.6157,0.1026,"",true,tab5) guiSetAlpha(LoginPassword,1) guiEditSetMasked ( LoginPassword, true ) GUIEditor_Label[2] = guiCreateLabel(0.0431,0.1906,0.2471,0.0616,"Username:",true,tab5) guiSetAlpha(GUIEditor_Label[2],1) guiLabelSetColor(GUIEditor_Label[2],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",false) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Label[3] = guiCreateLabel(0.0471,0.2962,0.251,0.0704,"Password:",true,tab5) guiSetAlpha(GUIEditor_Label[3],1) guiLabelSetColor(GUIEditor_Label[3],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[3],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",false) guiSetFont(GUIEditor_Label[3],"default-bold-small") guiSetAlpha(GUIEditor_Label[4],1) guiLabelSetColor(GUIEditor_Label[4],255,150,255) guiLabelSetVerticalAlign(GUIEditor_Label[4],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[4],"left",false) guiSetFont(GUIEditor_Label[4],"clear-normal") GUIEditor_Label[5] = guiCreateLabel(0.0784,0.0792,0.8314,0.0645,"Welcome in server Please Login",true,tab5) guiSetAlpha(GUIEditor_Label[5],1) guiLabelSetColor(GUIEditor_Label[5],255,150,255) guiLabelSetVerticalAlign(GUIEditor_Label[5],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[5],"left",false) guiSetFont(GUIEditor_Label[5],"clear-normal") GUIEditor_Button[1] = guiCreateButton(0.5216,0.4164,0.3961,0.0909,"Login!",true,tab5) guiSetAlpha(GUIEditor_Button[1],1) --------------------- tab6 = guiCreateTab("Register",tabPanel) --------------------- EditRegisterUsername = guiCreateEdit(0.298,0.1701,0.6157,0.1026,"",true,tab6) guiSetAlpha(EditRegisterUsername,1) EditRegisterPassword = guiCreateEdit(0.298,0.2815,0.6157,0.1026,"",true,tab6) guiEditSetMasked ( EditRegisterPassword, true ) guiSetAlpha(EditRegisterPassword,1) GUIEditor_Label[6] = guiCreateLabel(0.0431,0.1906,0.2471,0.0616,"Username:",true,tab6) guiSetAlpha(GUIEditor_Label[6],1) guiLabelSetColor(GUIEditor_Label[6],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[6],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[6],"left",false) guiSetFont(GUIEditor_Label[6],"default-bold-small") GUIEditor_Label[7] = guiCreateLabel(0.0471,0.2962,0.251,0.0704,"Password:",true,tab6) guiSetAlpha(GUIEditor_Label[7],1) guiLabelSetColor(GUIEditor_Label[7],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[7],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[7],"left",false) guiSetFont(GUIEditor_Label[7],"default-bold-small") GUIEditor_Button[2] = guiCreateButton(0.5216,0.4164,0.3961,0.0909,"Register!",true,tab6) guiSetAlpha(GUIEditor_Button[2],1) GUIEditor_Label[4] = guiCreateLabel(0.0784,0.0792,0.8314,0.0645,"Welome in Server Please Register",true,tab6) -----------------------------ربط الازراربلأوامر---------------- local localPlayer = getLocalPlayer ( ) function windowHandler( ) local playername = getPlayerName(localPlayer) guiSetText(LoginUsername, "") guiSetText(EditRegisterUsername, "") guiSetText(LoginUsername, playername) guiSetText(EditRegisterUsername, playername) guiSetInputEnabled(true) showCursor ( false) end function onClickBtn ( button, state ) if (source == GUIEditor_Button[1]) then triggerServerEvent ( "onLogin", getRootElement(), localPlayer, guiGetText(LoginUsername), guiGetText(LoginPassword) ) end end function onClickBtn2 ( button, state ) if (source == GUIEditor_Button[2]) then triggerServerEvent ( "onRegister", getRootElement(), localPlayer, guiGetText(EditRegisterUsername), guiGetText(EditRegisterPassword)) end end function hideLoginWindow() guiSetInputEnabled(false) showCursor ( false ) end addEvent( "hideLoginWindow", true ) addEventHandler( "hideLoginWindow", getRootElement(), hideLoginWindow ) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], onClickBtn, false ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], onClickBtn2, false ) --server side-- function onLogin ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else outputChatBox ( "Wrong username or password!", player, 255, 255, 0 ) -- Output they got the details wrong. end end addEvent( "onLogin", true ) addEventHandler( "onLogin", getRootElement(), onLogin ) function onRegister ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else account = addAccount ( user, pass ) if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) else outputChatBox ( "Register/Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end end end addEvent( "onRegister", true ) addEventHandler( "onRegister", getRootElement(), onRegister ) اي خطأ يصادفك طرحه وبصلحه
nony Posted July 24, 2012 Author Posted July 24, 2012 في خطا في التاب سيرفر وربط الازرار تمام لاكن التاب اذا حطيته ماقدر افتح اف2 واذا حذفته اقدر افتحه ^______^
3NAD Posted July 24, 2012 Posted July 24, 2012 tab5 = guiCreateTab("Login",tabPanel) tabPanel = اسم التاب الرئيسي حقك
nony Posted July 24, 2012 Author Posted July 24, 2012 tab5 = guiCreateTab("Login",tabPanel) tabPanel = اسم التاب الرئيسي حقك انا كتبتها كذا ----------------------------------------------- tab5 = guiCreateTab("Login",tabPanel) ------------------------------------------------ LoginUsername = guiCreateEdit(0.298,0.1701,0.6157,0.1026,"",true,tab5) guiSetAlpha(LoginUsername,1) LoginPassword = guiCreateEdit(0.298,0.2815,0.6157,0.1026,"",true,tab5) guiSetAlpha(LoginPassword,1) guiEditSetMasked ( LoginPassword, true ) GUIEditor_Label[2] = guiCreateLabel(0.0431,0.1906,0.2471,0.0616,"Username:",true,tab5) guiSetAlpha(GUIEditor_Label[2],1) guiLabelSetColor(GUIEditor_Label[2],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",false) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Label[3] = guiCreateLabel(0.0471,0.2962,0.251,0.0704,"Password:",true,tab5) guiSetAlpha(GUIEditor_Label[3],1) guiLabelSetColor(GUIEditor_Label[3],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[3],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",false) guiSetFont(GUIEditor_Label[3],"default-bold-small") guiSetAlpha(GUIEditor_Label[4],1) guiLabelSetColor(GUIEditor_Label[4],255,150,255) guiLabelSetVerticalAlign(GUIEditor_Label[4],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[4],"left",false) guiSetFont(GUIEditor_Label[4],"clear-normal") GUIEditor_Label[5] = guiCreateLabel(0.0784,0.0792,0.8314,0.0645,"Welcome in server Please Login",true,tab5) guiSetAlpha(GUIEditor_Label[5],1) guiLabelSetColor(GUIEditor_Label[5],255,150,255) guiLabelSetVerticalAlign(GUIEditor_Label[5],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[5],"left",false) guiSetFont(GUIEditor_Label[5],"clear-normal") GUIEditor_Button[1] = guiCreateButton(0.5216,0.4164,0.3961,0.0909,"Login!",true,tab5) guiSetAlpha(GUIEditor_Button[1],1) --------------------- tab6 = guiCreateTab("Register",tabPanel) --------------------- EditRegisterUsername = guiCreateEdit(0.298,0.1701,0.6157,0.1026,"",true,tab6) guiSetAlpha(EditRegisterUsername,1) EditRegisterPassword = guiCreateEdit(0.298,0.2815,0.6157,0.1026,"",true,tab6) guiEditSetMasked ( EditRegisterPassword, true ) guiSetAlpha(EditRegisterPassword,1) GUIEditor_Label[6] = guiCreateLabel(0.0431,0.1906,0.2471,0.0616,"Username:",true,tab6) guiSetAlpha(GUIEditor_Label[6],1) guiLabelSetColor(GUIEditor_Label[6],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[6],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[6],"left",false) guiSetFont(GUIEditor_Label[6],"default-bold-small") GUIEditor_Label[7] = guiCreateLabel(0.0471,0.2962,0.251,0.0704,"Password:",true,tab6) guiSetAlpha(GUIEditor_Label[7],1) guiLabelSetColor(GUIEditor_Label[7],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[7],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[7],"left",false) guiSetFont(GUIEditor_Label[7],"default-bold-small") GUIEditor_Button[2] = guiCreateButton(0.5216,0.4164,0.3961,0.0909,"Register!",true,tab6) guiSetAlpha(GUIEditor_Button[2],1) GUIEditor_Label[4] = guiCreateLabel(0.0784,0.0792,0.8314,0.0645,"Welome in Server Please Register",true,tab6)
3NAD Posted July 24, 2012 Posted July 24, 2012 ططيب التاب الرئيسي وينه ؟ tab5 = guiCreateTab("Login",tabPanel) tabPanel الأرقومنت الأخخير هذآ يعني أن الشيء اللي بـ تصنعه رآحح يكون داخله tabPanel لككن انت مآ صنعت الـ عششآن تجي الأكواد داخله
nony Posted July 24, 2012 Author Posted July 24, 2012 ططيب التاب الرئيسي وينه ؟ tab5 = guiCreateTab("Login",tabPanel) tabPanel الأرقومنت الأخخير هذآ يعني أن الشيء اللي بـ تصنعه رآحح يكون داخله tabPanel لككن انت مآ صنعت الـ عششآن تجي الأكواد داخله فهمني كيف اصنه الـــtabPanel؟
3NAD Posted July 24, 2012 Posted July 24, 2012 إخختصآر لـ نآفذة أو ششيء tabPanel هذآ وانت نآسخه والمفروض تاخذه كآمل لأن كذآ بيجيكـ أخطاء Gui Editor و لكن من الأفضضل انكـ تعمل لوحآت عن طريق سكربت و تبدأ تطبق عليه الأكواد فتح اللوحة إظهار الماوس عند الضغط .. و إلخخ
TAPL Posted July 24, 2012 Posted July 24, 2012 https://wiki.multitheftauto.com/wiki/GuiCreateTabPanel
nony Posted July 24, 2012 Author Posted July 24, 2012 إخختصآر لـ نآفذة أو ششيء tabPanel هذآ وانت نآسخه والمفروض تاخذه كآمل لأن كذآ بيجيكـ أخطاء Gui Editor و لكن من الأفضضل انكـ تعمل لوحآت عن طريق سكربت و تبدأ تطبق عليه الأكواد فتح اللوحة إظهار الماوس عند الضغط .. و إلخخ اها توني فهمت عليك انا مسوي تاب من قبل login و register وافتح الشوب عادي تجي النوافذ لاكن الاكواد الي نكتب فيها رقم التاب الي حطها حسون اذا حطيتها مايفتح الشوب واذا مسحتها يفتح الشوب
3NAD Posted July 24, 2012 Posted July 24, 2012 اها توني فهمت عليكانا مسوي تاب من قبل login و register وافتح الشوب عادي تجي النوافذ لاكن الاكواد الي نكتب فيها رقم التاب الي حطها حسون اذا حطيتها مايفتح الشوب واذا مسحتها يفتح الشوب سو لوححات عن ططريق ذا https://community.multitheftauto.com/ind ... ils&id=141
nony Posted July 24, 2012 Author Posted July 24, 2012 اها توني فهمت عليكانا مسوي تاب من قبل login و register وافتح الشوب عادي تجي النوافذ لاكن الاكواد الي نكتب فيها رقم التاب الي حطها حسون اذا حطيتها مايفتح الشوب واذا مسحتها يفتح الشوب سو لوححات عن ططريق ذا https://community.multitheftauto.com/ind ... ils&id=141 شكراااااااا على المود والله حلو + سهل
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