ID:1118478
 
(See the best response by Jemai1.)
Code:
mob
proc
Award()
usr.canaward=0
client<<S
var/obj/AWARD/A=new/obj/AWARD(client)
spawn(40)
usr.canaward=1
del(A)
MedalCheck()
var/Winter = world.GetMedal("Rockin' Around",usr,"mickemoose.mooselandxmas")
if(Winter==1)
if(usr.canaward==1)
Award()
else
spawn(41)
Award()
for(var/obj/AWARD/A in client.screen)
A.icon_state="Winter"
usr.hasWinter=1


Problem description:
Okay, So I can't seem to see what's missing or what's wrong. This snippet should check to see if I have the listed medal, which I do, then it checks to see if it can send me a popup. If it can't, then it waits until another popup (if any) is done before popping up. I'm pretty tired so i might just be overlooking some small thing.

What I want it to do: Check to see if there's any popup currently active, then if there isn't, to pop up, and if there is, to wait and then pop up.

What it currently does: It would popup and use the last popup as the only one. Now after adding the check and a canaward variable, it does nothing.
Best response
The syntax for spawn is
spawn(delay)
stuff() // the body should be tabbed like how you do it in if()
more_stuff()
non_spawn_stuff() // not part of spawn code

Also, no usr in procs.
Ah, that did it. Thanks for the help!