Overkillz Posted September 15, 2014 Share Posted September 15, 2014 Hey everyone, I hope u can help me with this little help Im trying to transform the number of the month to the name of the month For example 1 = January. I tried to do this month = { 1 = "January", 2 = "February", 3 = "March", 4 = "April", 5 = "May", 6 = "June", 7 = "July", 8 = "August", 9 = "September", 10 = "October", 11 = "November", 12 = "December", } local month = time.month[month] -- And after my code using dxDraw ... What is the problem ? Debugscript 3 Regards, Link to comment
Mr.Aleks Posted September 15, 2014 Share Posted September 15, 2014 month = { [1] = "January", [2] = "February", [3] = "March", [4] = "April", [5] = "May", [6] = "June", [7] = "July", [8] = "August", [9] = "September", [10] = "October", [11] = "November", [12] = "December" } local month = time.month[month] Link to comment
Overkillz Posted September 15, 2014 Author Share Posted September 15, 2014 A lot of thanks, now I have my last problem. It doens't show the month dxDrawText("#ff8800"month,0,110,screenWidth,screenHeight,tocolor(0,0,0,alpha),2,"default-bold","center","top",false,false,true,true) I need to add some other variable or something like that ? Link to comment
AboShanab Posted September 15, 2014 Share Posted September 15, 2014 dxDrawText("#ff8800".. month,0,110,screenWidth,screenHeight,tocolor(0,0,0,alpha),2,"default-bold","center","top",false,false,true,true) Link to comment
Overkillz Posted September 15, 2014 Author Share Posted September 15, 2014 dxDrawText("#ff8800".. month,0,110,screenWidth,screenHeight,tocolor(0,0,0,alpha),2,"default-bold","center","top",false,false,true,true) Thanks, anyway I get other problem: month = { [1] = "January", [2] = "February", [3] = "March", [4] = "April", [5] = "May", [6] = "June", [7] = "July", [8] = "August", [9] = "September", [10] = "October", [11] = "November", [12] = "December" } Line 38 local month = time.month[month] Link to comment
darhal Posted September 15, 2014 Share Posted September 15, 2014 Change table name to months and use that nonth = time.months[month] Link to comment
Overkillz Posted September 15, 2014 Author Share Posted September 15, 2014 Change table name to months and use thatnonth = time.months[month] month = { [1] = "January", [2] = "February", [3] = "March", [4] = "April", [5] = "May", [6] = "June", [7] = "July", [8] = "August", [9] = "September", [10] = "October", [11] = "November", [12] = "December" } local nonth = time.month[month] dxDrawText("#ff8800"..month,0,110,screenWidth,screenHeight,tocolor(0,0,0,alpha),2,"default-bold","center","top",false,false,true,true) Doesnt work Link to comment
xXMADEXx Posted September 15, 2014 Share Posted September 15, 2014 Try using this local month_ = month [ time.month - 1 ] Link to comment
DNL291 Posted September 15, 2014 Share Posted September 15, 2014 local tMonths = { [0] = "January", [1] = "February", [2] = "March", [3] = "April", [4] = "May", [5] = "June", [6] = "July", [7] = "August", [8] = "September", [9] = "October", [10] = "November", [11] = "December" } function getMonth() local month = getRealTime()["month"] return tMonths[month] end dxDrawText("#ff8800"..getMonth(),0,110,screenWidth,screenHeight,tocolor(0,0,0,alpha),2,"default-bold","center","top",false,false,true,true) 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