ID:1126276
 
Keywords: coding, error
Code:
world
proc
year()
global.month += 1
if(global.month>=13)
global.year += 1
global.month = 0
world<< "<font size=3><font color=green>It is now year [year] Month [month]"
for(var/mob/M in world)
if(M.client)
if(!M.dead)
//M.page += 1
M.pagem += global.month - M.pagem
if(M.pagem>=13)
M.page += 1
M.pagem = 0
//M.age = global.year-M.byear
M.agem += global.month - M.agem
if(M.agem>=13)
M.age+=1
M.agem=0
if(M.dead)
M.page = M.dyear
M<<"You are now [M.page].[M.pagem] years old.(Spiritually: [M.age].[M.agem] years old) "

//M.overlays -= 'halo.dmi'
//M.overlays -= 'halo.dmi'
//M.loc = locate(97,79,2)
//M.safe = 0
//M.dead = 0
//world<<"<font size=2><font color=red>There will be a Chuunin exam in 10 minutes - Go to the Chuunin room theres one in the middle of all the villages(not leaf)..."
//global.year += 1
sleep(10)
if(prob(10))
world<<"The moon comes out." // put a waether proc here after u make one
spawn(10) year()


Problem description:
okay so the months change but the years wont change or add to it
No such thing as month 0 just FYI.
There aren't 13 months. Just 12. o.O

if(global.month>=13)
In response to Blastcore
Yes but since OP isn't using day's the only way to distinguish a new month is to go over it so to return to month 1 you must go over 12 otherwise month 12 would become month 1.

Or in OP's case month 0..
I made a Timer for my project using a datum.
Here I give you the example I got, amplified with months and years;
#define INVERTED 1
#define NORMAL 0

var/Timer/MyDate = new;

Timer

parent_type = /datum

var
Mode

Seconds = 0
Minutes = 0
Hours = 0

// New implementation, Months and Years
Day = 1
Month = 1
Year = 1

New(h=0, m=0, s=0, day=1, month=1, year=1, mode = NORMAL)
.=..()

Hours = h
Minutes = m
Seconds = s
Day = day
Month = month
Year = year
Mode = mode

spawn doTime()

proc/doTime()
while(src)
if(Mode & INVERTED)
if(!Seconds && !Minutes && !Hours)
del src
if(Seconds-- == 0)
if(Minutes-- > -1)
Seconds = 60
if(!Minutes && Hours-- > -1)
Minutes = 60

else if(Mode & NORMAL)
if(Seconds++ == 60)
Seconds = 0
if(Minutes++ == 60)
Minutes = 0
if(Hours++ == 24)
Hours = 0
var needDays = Month % 2
if(Day++ == (needDays ? 31 : 30))
Day = 1
if(Month++ == 13)
Month = 1
Year++
for(var/client/C)
C.mob.ageUp()


mob/proc/ageUp()
..()


Include this file and override the AgeUp proc to what you
want to do when a player ages up.