Mr.Mostafa Posted January 25, 2019 Share Posted January 25, 2019 سلام عليكم ابي طريقة تجيب اليوم وش ؟ خميس - جمعة - سبت , الخ وشكرا Link to comment
Guest Posted January 25, 2019 Share Posted January 25, 2019 (edited) tostring + table Edited January 25, 2019 by Guest Link to comment
Mr.Mostafa Posted January 25, 2019 Author Share Posted January 25, 2019 25 minutes ago, DABL said: tostring + table فكرته طيب بتكون كيف ؟ اجيب رقم اليوم وابدله ولا كيف Link to comment
KillerX Posted January 25, 2019 Share Posted January 25, 2019 42 minutes ago, Mr.Mostafa said: سلام عليكم ابي طريقة تجيب اليوم وش ؟ خميس - جمعة - سبت , الخ وشكرا سويتلك فنكشن لطلبك function GetDay () Days = { 'الاحد' , 'الاثنين','الثلاثاء','الاربعاء','الخميس','الجمعه','السبت' } local _myTime = getRealTime() local _weekDay = _myTime[ 'weekday' ] return Days[_weekDay+1] end Link to comment
Guest Posted January 25, 2019 Share Posted January 25, 2019 (edited) 6 minutes ago, Mr.Mostafa said: فكرته طيب بتكون كيف ؟ اجيب رقم اليوم وابدله ولا كيف Days = { [1] = "الأحد", [2] = "الاثنين", [3] = "الثلاثاء", [4] = "الأربعاء", [5] = "الخميس", [6] = "الجمعة", [7] = "السبت" } time = getRealTime() num = tonumber(time.weekday)+1 day = Days[num+1] tostring("" .. day .."") -- كذآ آضن وآلله، بآلجوآل الحين انا . - ذا مجرد مثآل ماهو كود كامل Edited January 25, 2019 by Guest Link to comment
Ahmed Ly Posted January 25, 2019 Share Posted January 25, 2019 (edited) week = { ["0"] = "الاحد", ["1"] = "الاثنين", ["2"] = "الثلاثاء", ["3"] = "الاربعاء", ["4"] = "الخميس", ["5"] = "الجمعة", ["6"] = "السبت" } function getNameday() local time = getRealTime() local nameday = time.weekday for i, v in pairs ( week ) do if string.find ( i , nameday ) then if v ~= "" then return v end end end end addCommandHandler("today", function (p) name = getNameday() outputChatBox(name,p,255,0,0,true) end ) Edited January 25, 2019 by Ahmed Ly Link to comment
KillerX Posted January 25, 2019 Share Posted January 25, 2019 1 minute ago, DABL said: Days = { [1] = "الأحد", [2] = "الاثنين", [3] = "الثلاثاء", [4] = "الأربعاء", [5] = "الخميس", [6] = "الجمعة", [7] = "السبت" } day = Days[num] tostring("" .. day .."") -- كذآ آضن وآلله، بآلجوآل الحين انا . - ذا مجرد مثآل ماهو كود كامل اولا ارقام الايام بتبدا من صفر + اللي فهمتوا num هو الرقم كذا خطا لازم تزود رقم عليه لايجاد اليوم الصحيح مثل كدا day = Days[num+1] Link to comment
Guest Posted January 25, 2019 Share Posted January 25, 2019 Just now, KillerX said: اولا ارقام الايام بتبدا من صفر + اللي فهمتوا num هو الرقم كذا خطا لازم تزود رقم عليه لايجاد اليوم الصحيح مثل كدا day = Days[num+1] Just now, KillerX said: كذآ آضن وآلله، بآلجوآل الحين انا . الجهاز حقي ابو كشاف. Link to comment
KillerX Posted January 25, 2019 Share Posted January 25, 2019 1 minute ago, Ahmed Ly said: week = { ["0"] = "الاحد", ["1"] = "الاثنين", ["2"] = "الثلاثاء", ["3"] = "الاربعاء", ["4"] = "الخميس", ["5"] = "الجمعة", ["6"] = "السبت" } function getNameday() local time = getRealTime() local nameday = time.weekday for i, v in pairs ( week ) do if string.find ( i , nameday ) then if v ~= "" then return v end end end end addCommandHandler("today", function (p) name = getNameday() outputChatBox(name,p,255,0,0,true) end ) ا اظن انك طولت الفنكشن Link to comment
Mr.Mostafa Posted January 25, 2019 Author Share Posted January 25, 2019 4 minutes ago, DABL said: time.weekday شكرا لكم بس weekday هادا ترجع وش بالظبط ؟؟ Link to comment
Ahmed Ly Posted January 25, 2019 Share Posted January 25, 2019 Just now, Mr.Mostafa said: شكرا لكم بس weekday هادا ترجع وش بالظبط ؟؟ 0 = الاحد وكذا ارقام حسب يوم من 0 الي 6 Link to comment
KillerX Posted January 25, 2019 Share Posted January 25, 2019 Just now, Mr.Mostafa said: شكرا لكم بس weekday هادا ترجع وش بالظبط ؟؟ ترجع يوم الاسبوع يعني النهاردة الجمعه ترجع الرقم 5 Link to comment
Mr.Mostafa Posted January 25, 2019 Author Share Posted January 25, 2019 Just now, Ahmed Ly said: 0 = الاحد وكذا ارقام حسب يوم من 0 الي 6 اها يب , تمام Link to comment
SycroX Posted January 26, 2019 Share Posted January 26, 2019 https://wiki.multitheftauto.com/wiki/FormatDate ذي افضل تجيب لك كل شي 2 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