ID:269746
 
Code:
mob/proc
examtime()
if(src.rank == "Academy Student")
spawn(33000)
usr <<"<b>Exam in 5 mins</b>"
teston=1
spawn(3000)
usr << "You may take the test now."
teston=0
examtime()


Problem description:Thats my proc for the exam i basically want it to tell everyone with the rank academy student every 55 mins it will warn u that theres a test soon and every hour it will say the test has began
Why dosen't the code work?

No usr in proc, by the way.
He doesn'tknow why it doesn't work, which is why he's here, PirateHead.

AS for the proc, you need to make sure you call it for the player when he logs in. Also, you may want to use sleep() in place of spawn(). Instead of calling the proc over and over, you may want to use while() with a delay, but tat's just me.

Most importantly with using the while() proc, keep rank checks in there so the player is not able to take a test if he advances a rank while the proc is running.
mob/Login()
..()
src.examtime()
mob/proc
examtime()
set background=1
while(src.rank=="Academy Student")
sleep(33000)
if(src.rank!="Academy Student") return
src<<"<b>Exam in 5 minutes!</b>"
teston=1
sleep(3000)
if(src.rank!="Academy Student") return
src<<"You may take te test now."
teston=0


That will notify them with the time and it will continue to run while they are an Academy Student. Mae sure that you have Academy Student spelled correctly everywhere in your code. Also, this is an unusually long time to hae to wait for a test.
In response to CaptFalcon33035
I believe it would be better to have the proc as not a mob proc and only one proc so that you do not have so many loops running for every single player.

proc
examtime()
set background=1
while(1)
sleep(3300)
for(var/mob/M)
if(M.rank=="Academy Student")
M<<"<B>Exam in 5 minutes!</b>"
teston=1
sleep(3000)
for(var/mob/M)
if(M.rank=="Academy Student")
M<<"You may take the test now."
teston=0

You may have to add to the var/mob/M extension depending on what you for players. Such as mob/players/M.
In response to Kija
I originally thought that as well, but, he may want people to actually play an hour before they get to take the exam. That procedure will allow the player to take the exam after just 1 second, depending on when they login, if they're lucky.
In response to CaptFalcon33035
Yes, I suppose that could cause a problem. But I suppose he have some sort of time var added to the mobs to compare it to the world time, and if they are too similiar, they cannot take the test, if that is actually what he wants.