Blockland Forums > Modification Help
A clock.
PhantOS:
You forgot the : after case and you can't nest ifs or loops into case results
Doctor Disco:
Oh, frick
ty
PhantOS:
Also what you're doing is stupid. Just increment days, write a function that divides the days by 31 and prints out a month. Having a day counter and a month counter is excessive, it's better to stick with a day counter and just make a basic return function that prints out a month.
If this is too complex, here's a tip: don't use a month variable- just use a day variable, divide by 31 and round down using mFloor(); and use the number you get to return a month
Example:
--- Code: ---Function dayToMonth(%day)
{
%val = mFloor(%day/31);
Switch(%val)
{
Case 0:
Return "January";
Case 1:
Return "Febuary";
Default:
Return "Nan";
}
}
--- End code ---
Then if you do echo(daytomonth(32)); you'll get Febuary, etc. to get the exact day of the month, use modulus % or subtract month*day from the total daycount
Conan:
you’re gonna get wrong values on day 31+30, and it only gets worse from there. phantos pls
better is to hardcode array that states whats the max day of a month. i’ll expand this post later
thegoodperry:
For an rpg server where days go by every minute, that level of accuracy isn't necessary. Using 30 days per month for every month is like super easy and nobody notices the difference