RLP[Farouk] Posted September 24, 2012 Share Posted September 24, 2012 شباب ممكن كود لما اشغل السيرفر يشتغل معاه ملفات من الريسورس انا اخترته ؟؟؟ وفين بالظبت احطه؟ Link to comment
TAPL Posted September 24, 2012 Share Posted September 24, 2012 mtaserver.conf في ملف في آخر الملف تلقى زي كذا هذا لتشغيل لوحة الأدمنية مع بداية تشغيل السيرفر "admin" startup="1" protected="0"/> حط تحته "اسم المود الي تبي يشتغل مع بداية تشغيل السيرفر" startup="1" protected="0"/> mtaserver.conf للمزيد من المعلومات عن ملف https://wiki.multitheftauto.com/wiki/Server_mtaserver.conf Link to comment
RLP[Farouk] Posted September 24, 2012 Author Share Posted September 24, 2012 الله يعطيك مليون عافيه!!! Link to comment
RLP[Farouk] Posted September 24, 2012 Author Share Posted September 24, 2012 عندي بس طلب انا وضعت loginpanel بس لما الواحد يسجل بضل الصورة معلقة كيف بدي اخليه ينزل مكان معين بعد التسجيل فقط؟؟ Link to comment
TAPL Posted September 24, 2012 Share Posted September 24, 2012 https://wiki.multitheftauto.com/wiki/OnPlayerLogin https://wiki.multitheftauto.com/wiki/SpawnPlayer https://wiki.multitheftauto.com/wiki/SetCameraTarget Link to comment
RLP[Farouk] Posted September 24, 2012 Author Share Posted September 24, 2012 ممكن تضع مثال كامل الله يخليك لاني ما اتعلم الا هيك Link to comment
TAPL Posted September 24, 2012 Share Posted September 24, 2012 addEventHandler("onPlayerLogin", root, function() spawnPlayer(source, x, y, z) setCameraTarget(source) end) Link to comment
RLP[Farouk] Posted September 24, 2012 Author Share Posted September 24, 2012 هيك مظبوط؟؟؟ function setCameraOnPlayerJoin() fadeCamera( source, true ) setCameraMatrix( source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316 ) end addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) --function stopCameraOnPlayerLogin() -- fadeCamera( source, false ) --end --addEventHandler("onPlayerLogin", getRootElement(), stopCameraOnPlayerLogin) addEvent("submitLogin", true) addEvent("submitRegister", true) function loginHandler(username, password) local account = getAccount(username, password) if (account ~= false) then if (logIn(source, account, password) == true) then triggerClientEvent (source, "hideLoginWindow", source) end end end addEventHandler("submitLogin", root, loginHandler) function registerHandler(username, password) local account = getAccount(username, password) if (account ~= false) then outputChatBox( "", root, 255, 255, 255 ) else account = addAccount(username, password) if (logIn(source, account, password) == true) then triggerClientEvent(source, "hideRegisterWindow", getRootElement()) end end end addEventHandler("submitRegister", root, registerHandler) addEventHandler("onPlayerLogin", root, function() spawnPlayer(source, 1682.9846191406, -2245.932189063, 13.547117233276) setCameraTarget(source) end) Link to comment
TAPL Posted September 24, 2012 Share Posted September 24, 2012 يفترض أنه يشتغل جرب الكود و قل لنا النتيجة Link to comment
RLP[Farouk] Posted September 24, 2012 Author Share Posted September 24, 2012 زر login ما اشتغل Link to comment
MR.S3D Posted September 24, 2012 Share Posted September 24, 2012 هات الكلنت والسيرفر وانا ازبطه لك Link to comment
RLP[Farouk] Posted September 24, 2012 Author Share Posted September 24, 2012 ملاحظة: انا اريد ان ينزل الاعب الجديد في مكان معيين بعد التسجيل فقط هذه الاكواد ما عدلت عليها شي الكلنت ما دخله انا لما اعدل على ملف السيرفر الازرار تخرب Client: -- REPLACE THIS ! local serverInfo = "Put server information here" 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 local loginWindow = {} local loginLabel = {} local loginEdit = {} local loginButton = {} local mainButton = {} local mainLabel = {} local mainMemo = {} local registerWindow = {} local registerLabel = {} local registerEdit = {} local registerButton = {} -- Login loginWindow["mainWindow"] = guiCreateWindow (0,0,505, 235,"Welcome to the server!", false) centerWindow( loginWindow["mainWindow"] ) guiWindowSetMovable( loginWindow["mainWindow"], false ) guiWindowSetSizable( loginWindow["mainWindow"], false ) guiSetInputEnabled( true ) showCursor(true) loginLabel["Username"] = guiCreateLabel( 20, 40, 70, 20, "Username:", false, loginWindow["mainWindow"]) loginEdit["Username"] = guiCreateEdit( 82, 38, 90, 20, "", false, loginWindow["mainWindow"] ) loginLabel["Password"] = guiCreateLabel( 20, 70, 70, 20, "Password:", false, loginWindow["mainWindow"]) loginEdit["Password"] = guiCreateEdit( 82, 68, 90, 20, "", false, loginWindow["mainWindow"] ) loginButton["Main"] = guiCreateButton( 82, 98, 90, 30, "Login", false, loginWindow["mainWindow"] ) -- Main mainLabel["New"] = guiCreateLabel( 57, 148, 160, 30, "Are you new to the server?", false, loginWindow["mainWindow"] ) mainButton["ClickHere"] = guiCreateButton( 82, 178, 90, 30, "Click here!", false, loginWindow["mainWindow"] ) mainMemo["ServerInfo"] = guiCreateMemo( 230, 38, 265, 170, serverInfo, false, loginWindow["mainWindow"] ) -- register registerWindow["mainWindow"] = guiCreateWindow (0,0,250, 150,"Register", false) centerWindow( registerWindow["mainWindow"] ) guiSetVisible( registerWindow["mainWindow"], false ) registerLabel["Username"] = guiCreateLabel( 45, 40, 70, 20, "Username:", false, registerWindow["mainWindow"]) registerEdit["Username"] = guiCreateEdit( 107, 38, 90, 20, "", false, registerWindow["mainWindow"] ) registerLabel["Password"] = guiCreateLabel( 45, 70, 70, 20, "Password:", false, registerWindow["mainWindow"]) registerEdit["Password"] = guiCreateEdit( 107, 68, 90, 20, "", false, registerWindow["mainWindow"] ) registerButton["Main"] = guiCreateButton( 107, 98, 90, 30, "Register", false, registerWindow["mainWindow"] ) registerButton["Close"] = guiCreateButton( 30, 30, 20, 20, "X", false, registerWindow["mainWindow"]) guiEditSetMasked(registerEdit["Password"], true) guiEditSetMasked(loginEdit["Password"], true) function clientSubmitLogin(button, state) if button == "left" and state == "up" then local username = guiGetText(loginEdit["Username"]) local password = guiGetText(loginEdit["Password"]) if username and password then triggerServerEvent("submitLogin",localPlayer, username, password) end end end addEventHandler("onClientGUIClick", loginButton["Main"], clientSubmitLogin, false) function clientSubmitRegister(button, state) if button == "left" and state == "up" then local username = guiGetText(registerEdit["Username"]) local password = guiGetText(registerEdit["Password"]) if username and password then triggerServerEvent("submitRegister",localPlayer, username, password) end end end addEventHandler("onClientGUIClick", registerButton["Main"], clientSubmitRegister, false) function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible(loginWindow["mainWindow"], false) showCursor(false) end function showRegisterWindow() guiSetInputEnabled( true ) guiSetVisible(registerWindow["mainWindow"], true) showCursor(true) guiSetVisible(loginWindow["mainWindow"], false) end addEventHandler("onClientGUIClick", mainButton["ClickHere"], showRegisterWindow, false) function hideRegisterWindow1() guiSetInputEnabled( true ) guiSetVisible(registerWindow["mainWindow"], false) showCursor(true) guiSetVisible(loginWindow["mainWindow"], true) end addEventHandler("onClientGUIClick",registerButton["Close"], hideRegisterWindow1, false) function hideRegisterWindow() guiSetInputEnabled( false ) guiSetVisible(registerWindow["mainWindow"], false) showCursor(false) end addEvent("hideRegisterWindow", true) addEvent("hideLoginWindow", true) addEventHandler("hideRegisterWindow", getRootElement(), hideRegisterWindow) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) Server: function setCameraOnPlayerJoin() fadeCamera( source, true ) setCameraMatrix( source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316 ) end addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) --function stopCameraOnPlayerLogin() -- fadeCamera( source, false ) --end --addEventHandler("onPlayerLogin", getRootElement(), stopCameraOnPlayerLogin) addEvent("submitLogin", true) addEvent("submitRegister", true) function loginHandler(username, password) local account = getAccount(username, password) if (account ~= false) then if (logIn(source, account, password) == true) then triggerClientEvent (source, "hideLoginWindow", source) end end end addEventHandler("submitLogin", root, loginHandler) function registerHandler(username, password) local account = getAccount(username, password) if (account ~= false) then outputChatBox( "", root, 255, 255, 255 ) else account = addAccount(username, password) if (logIn(source, account, password) == true) then triggerClientEvent(source, "hideRegisterWindow", getRootElement()) end end end addEventHandler("submitRegister", root, registerHandler) Link to comment
TAPL Posted September 24, 2012 Share Posted September 24, 2012 function setCameraOnPlayerJoin() fadeCamera( source, true ) setCameraMatrix( source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316 ) end addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) --function stopCameraOnPlayerLogin() -- fadeCamera( source, false ) --end --addEventHandler("onPlayerLogin", getRootElement(), stopCameraOnPlayerLogin) addEvent("submitLogin", true) addEvent("submitRegister", true) function loginHandler(username, password) local account = getAccount(username, password) if (account ~= false) then if (logIn(source, account, password) == true) then triggerClientEvent (source, "hideLoginWindow", source) end end end addEventHandler("submitLogin", root, loginHandler) function registerHandler(username, password) local account = getAccount(username, password) if (account ~= false) then outputChatBox( "", root, 255, 255, 255 ) else account = addAccount(username, password) if (logIn(source, account, password) == true) then triggerClientEvent(source, "hideRegisterWindow", getRootElement()) spawnPlayer(source, 1682.9846191406, -2245.932189063, 13.547117233276) setCameraTarget(source) end end end addEventHandler("submitRegister", root, registerHandler) Link to comment
RLP[Farouk] Posted September 24, 2012 Author Share Posted September 24, 2012 الله يعطيك العافيه تعبتك معاي 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