Jump to content

#Major .

Members
  • Posts

    861
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by #Major .

  1. واذا صصكه ميوت بتايمر والاعب طلع ورجع خش بينصك مره ثثانيه وعلى هالحال واذا انفك ميوته وطلع وخش بينصك مره ثانيه لانه بالقاعدة
  2. function getTableFromSql ( id ) local aRow = executeSQLQuery( "SELECT myTable FROM `Table_System` WHERE ID=?",id ) if ( type ( aRow ) == "table" and #aRow == 0 ) or not aRow then return {""} end return fromJSON ( aRow [1] [ "myTable" ] ) end @!#NssoR_) عدل الي فوق بهذا لو سمحت
  3. السلام عليكم ورحمة الله وبركاتة اليوم وانا جالس اتعلم طريقة احفظ فيها الجداول في السكل بستخدام ( التوجوسن, فروم جوسن ) سويت 2 يوزفل فنكشن يمكن تفيد المبتدئين ? المهم حبيت انشرها بدال م اجلس محتفظ فيها setTableToSql getTableFromSql نبدا بالاول x[ setTableToSql ]x السانتكس \ Syntax setTableToSql( id, theTable ) id = ايدي او رقم الجدول الي تبي تحفظة theTable = اسم الجدول الي تبي تحفظة بالسكل الكود \ Code executeSQLQuery ('CREATE TABLE IF NOT EXISTS Table_System (ID, myTable)') function setTableToSql( id, theTable ) local Results = executeSQLQuery("SELECT myTable FROM `Table_System` WHERE ID=?", id ) if ( type ( Results ) == "table" and #Results == 0 or not Results ) then executeSQLQuery ( "INSERT INTO `Table_System` ( ID, myTable ) VALUES(?, ?)",id , toJSON ( theTable ) ) else executeSQLQuery('UPDATE `Table_System` SET myTable =? WHERE ID =?',toJSON ( theTable ),id ) end end مثآل \ Examble Table = { {"I'm"}, {"The"}, {"King"}, } addEventHandler( "onResourceStop",resourceRoot, function() setTableToSql( 1, Table) end ) x[ getTableFromSql ] x طبعًا الوضيفة سواها لي عبد الكريم وانا عدلت عليها وضفت ارقمنت الايدي عشان لو حاب يضيف اكثر من جدول @Abdul KariM السانتكس \ Syntax getTableFromSql ( id ) id = ايدي او رقم الجدول الي تبي تجيبة من السكل الكود \ Code function getTableFromSql ( id ) local aRow = executeSQLQuery( "SELECT myTable FROM `Table_System` WHERE ID=?",id ) if ( type ( aRow ) == "table" and #aRow == 0 ) or not aRow then return {""} end return fromJSON ( aRow [1] [ "myTable" ] ) end مثآل \ Examble TableT = {} addEventHandler( "onResourceStart",resourceRoot, function() local table = getTableFromSql( 1 ) if table then TableT = table end end )
  4. شكرا حبيبي واي فاي ونورت الموضوع والمنتدى بتواجدك اشتقنا لك
  5. جميل جدا ورائع استمر حبيبي وشكرا ع الاهداء
  6. شكرا لك جزيلل الشكر على تثبيت وتميز الموضوع ولو لفترة مؤقتة والمساهمه واجبنا شكرا
  7. كفو اقنعتني صراحة هههههههههههههههههههههه حبيب قلبي شكرا
  8. حياك الله حبيبي شكرا لك شكرا لك حيآك الله بأي وقت هذا هو الهدف من الموضوع شكرا
  9. حياك الله ي بعيد الله يعافيك هذا واجبناه
  10. شكرا لك حبيبي هههههههه حياك الله حبيبي شكرا وياك ي رب منور الموضوع حبيبي اذا فيه احد يشرح هذي لو تكرمتوا لاني م فهمتها شكرا
  11. اليوم بشرح الوضائف الجديدة الخاصة بالاكاونت { getAccountByID , getAccountID , getAccountIP , getAccountsByData , getAccountsByIP , setAccountName } بسم الله نبدأ x[ getAccountByID ]x شرح الوضيفة \ Explain the function This function returns the account with the specific ID. / تقوم الوضيفة بإرجاع الحساب عبر الايدي او المعرف الخآص به السانتكس \ Syntax account getAccountByID ( int id ) id = The ID to get account from / الآيدي الي تبي تجلب فيه الحساب عن طريقة العائدات / Returns Returns account associated with specified ID. Returns false if invalid arguments were specified or there is no account with this ID. / ارجاع الحساب المرتبط بالمعرف او الإيدي ,إرجاع قيمة منطقية بـ فولس إذا كان الحساب غير موجود مثآل \ Examble addCommandHandler("getAccount", -- نسوي امر جديد function (player, cmd, id) id = tonumber(id) -- نجلب الايدي من الامر local account = getAccountByID(id) -- نجيب الحساب من الايدي if account then -- نتحقق ان الحساب موجود او لا outputChatBox("The name of the account with that ID is: "..getAccountName(account), player) -- اخراج نص بـ أسم الحساب الي جبناه else -- اذا الحساب مو موجود outputChatBox("There is no account with this ID.", player) -- اخراج نص بـ ان لا يوجد حساب يمتلك هذا الاي دي end end) x[ getAccountID ]x شرح الوضيفة \ Explain the function This function retrieves the ID of an account. / تستخدم هذه الوضيفة لجلب الآيدي او المعرف الخاص بالحساب السانتكس \ Syntax int getAccountID ( account theAccount ) theAccount = The account you wish to get the ID of. / الحساب الذي تريد جلب الآيدي او المعرف الخاص به العائدات / Returns Returns a int containing the account's ID, false if the account does not exist or an invalid argument was passed to the function. / ارجاع رقم انتقر او رقم صحيح يحتوي ع ايدي الحساب المُدخل, إرجاع قيمة منطقية بـ فولس إذا كان الحساب غير موجود مثآل \ Examble function outputOnLogin ( previous_account, current_account, auto_login ) --when a player logs in / لما الاعب يسجل دخول outputConsole("["..getAccountID(previous_account).."] "..getAccountName(previous_account).." Logged into ["..getAccountID(current_account).."]"..getAccountName(current_account)) -- announce it into the console / استخراج نص للكونسل بـ أيدي حسابة القديم و الجديد end addEventHandler("onPlayerLogin",getRootElement(),outputOnLogin ) --add an event handler / اضافة حدث x[ getAccountIP ]x شرح الوضيفة \ Explain the function This function retrieves the IP-address of an account. / تستخدم هذي الوضيفة لجلب عنوان الايبي ادريسس للحساب المحدد السانتكس \ Syntax string getAccountIP ( account theAccount ) theAccount = The account you wish to get the IP of. / الحساب الذي تريد جلب الايبي ادريسس الخاص به العائدات / Returns Returns a string containing the account's IP, false if the account does not exist or an invalid argument was passed to the function. / إرجاع سلسلة نصية تحتوي على عنوان الايبي ادريسس للحساب المُدخل, إرجاع قيمة منطقية بـ فولس إذا كان الحساب غير موجود مثآل \ Examble function outputOnLogin ( previous_account, current_account, auto_login ) --when a player logs in / عند تسجيل دخول الاعب outputDebugScript(getPlayerName(source).."logged into his account with IP "..getAccountIP(previous_account)) -- announce it into the debugscript / إخراج نص للدي بق بـ عنوان الاإيبي ادريس للحساب إو الاعب end addEventHandler("onPlayerLogin",getRootElement(),outputOnLogin ) --add an event handler / اضافة حدث x[ getAccountsByData ]x شرح الوضيفة \ Explain the function This function returns a table containing all accounts with specified dataName and value (set with setAccountData). / تقوم هذه الوضيفة بإرجاع جدول يحتوي على جميع الحسابات التي تمتلك على داتا محددة ( setAccountData ) :تم تعينها بإستخدام وضيفة السانتكس \ Syntax table getAccountsByData ( string dataName, string value ) dataName = The name of the data / اسم الداتا value = The value the dataName should have / اشتراط ان تكون قيمة الداتا العائدات / Returns Returns table containing the accounts associated with specified value at dataName. Returns false if invalid arguments were specified. / جدول يحتوي على الحسابات المرتبطة بالقيمة المحددة في الداتا, إرجاع قيمة منطقية بـ فولس إذا تم تحديد ارقمنات غير صالحة مثآل \ Examble addCommandHandler("accountsbydata", function (player) -- add Command / إضافة امر local account = getPlayerAccount(player) -- Set the variable to the player account / تعين المتغير بـ حساب الاعب setAccountData(account, "test", "hello") -- Set the data and the value set on the account / وضع داتا معينة وقيمة لها على الحساب local accounts = getAccountsByData("test", "hello") -- Set the variable to the table containing the accounts associated with dataName and valueData / تعين المتغير بجدول يحتوي على الحسابات المرتبطة بالداتا والقيمة الخاصة بها outputChatBox(getAccountName(accounts[1]), player) -- The output text that contains the first account in the table / إخراج نص يحتوي على إول حساب في الجدول end) x[ getAccountsByIP ]x شرح الوضيفة \ Explain the function This function returns a table containing all accounts that were logged onto from specified IP-address. / تقوم هذه الوضيفة بإرجاع جدول يحتوي على كافة الحسابات التي تم تسجيلها من عنوان الإيبي ادريس المحدد السانتكس \ Syntax table getAccountsByIP ( string ip ) ip = The IP to get accounts from / الإيبي ادريس المراد الحصول على الحسابات المسجلة به العائدات / Returns Returns table containing the accounts associated with specified IP-address. Returns false if invalid arguments were specified. / تقوم هذه الوضيفة بإرجاع جدول يحتوي على الحسابات المرتبطة بعنوان الايبي ادريس المحدد, إرجاع قيمة منطقية بـ فولس اذا تم تحديد ارقمنات غير صالحة مثآل \ Examble addCommandHandler("getAccounts", -- add Command / إضافة امر function (player, cmd) local ip = getPlayerIP(player) -- Set the variable to the player IP / تعين المتغير بـ إيبي الاعب local accounts = getAccountsByIP(ip) -- Set the variable to the table containing the accounts associated with IP / تعين المتغير بجدول يحتوي على الحسابات المرتبطة بالإيبي المسجل بها outputChatBox("You have " .. #accounts .. " accounts.", player) -- Output text in the number of recorded accounts in player IP-address / إخراج نص بعدد الحسابات المسجلة في إيبي ادريس الاعب end) x[ setAccountName ]x شرح الوضيفة \ Explain the function This function sets the name of an account. / تقوم هذه الوضيفة بتحديد اسم الحساب المحدد السانتكس \ Syntax bool setAccountName ( account theAccount, string name [, bool allowCaseVariations = false] ) theAccount = The account you wish to change the name./الحساب الذي تريد تعين الاسم له name = The new name.. / الإسم الجديد للحساب allowCaseVariations = Whether the username is case sensitive (if this is set to true, usernames "Bob" and "bob" will refer to different accounts) العائدات/ Returns Returns a true if the account name was set, false if an invalid argument was specified. / تقوم هذه الوضيفة بإرجاع قيمة منطقية بـ ترو إذا تم تعين اسم الحساب, إرجاع قيمة منطقية بـ فولس اذا تم تحديد ارقمنات غير صالحة مثآل \ Examble addCommandHandler("changeaccountname", function(player, _, oldname, newname) -- add Command / اضافة امر if not oldname or not newname then -- Verify that the oldname and newname value exist / تحقق من وجود قيمة oldname و newname return end local account = getAccount(oldname)-- Set the variable to the account whose name will be changed / تعين المتغير بـ الحساب المراد تغير اسمه if not account then -- Verify that the specified account exists / تحقق من وجود الحساب المحدد return end setAccountName(account, newname) -- Set the specified account name to the newname / وضع إسم الحساب المحدد إلى الـ newname end) الحمد لله وصلنآ إلى نهاية الشرح إتمنى انه اعجبكم وماكان صعب عليكم الإهداءات/ Dedications @KhaledAlamri @#َxLysandeR @!#NssoR_) @#_iMr,[E]coo @#StrOnG_,) @iMr.WiFi..! @بويكا @Master_MTA @N3xT @#DRAGON!FIRE @[T]|O|[P]George @MrKAREEM @ccz @killerProject @#DesTroeyR @Rakan# @الباقي بالقلب
  12. السلام عليكم ورحمة الله كيف اقدر اخلي الاعب م يقدر يضغط ع الكولمن؟ الخاص بالجريد ليست عشان م يخبص الترتيب؟
  13. السكل سهل واعرف له لكن طلبي واضح ابي اجيب لاعب وانفذ عليه فنكشنات
  14. ايه وبعدين كيف اقدر اجيبه وانفذ عليه فنكشنات؟
  15. السلام عليكم كيف اقدر اجيب لاعب ماهو موجود اساسًا بالسيرفر؟
×
×
  • Create New...