ID:145655
 
Code: HUD Day/Night Timer
area/outside
var
min = 0
sec = 0
proc
Get_dntime()
return "[min]:[sec]" // #1-HERE!!!!
proc
dncycletimer()
if(60)
min++
sec = 0
else sec++
if(min == 25)
daycycle()
sleep(10)
dncycletimer()

obj
hud
dntime
name = "Day/Night Timer"
icon = 'hud.dmi' //Its icon file
icon_state = "dn"
screen_loc = "6,11" //Were it shows up on the screen
Click() //When you click it
Get_dntime() // #2-TO HERE!!!!!!!

mob/Login() //When you login
var/obj/hud/dntime/A = new() //Defines the HUD
usr.client.screen += A //Adds the HUD
..()


Problem description: I keep getting an error for #1:

error:Get_dntime:undefined proc


I have an idea of what's wrong (Fairly obvious problem :P) But I don't know where I would put #1 so that #2 reads it correctly.
The proc Get_dntime() is listed as an area proc, you are trying to call it on an object.
Basically, here is what you did:

Talking to Area: (You): I'm giving you this proc!

Talking to Obj: (You): Use this proc! Error? Double you tee eff? <-- You didn't give the Obj the proc, so it can't use it, you gave it to the area.

You could do this a few other ways, such as:

obj
hud
dntime
name = "Day/Night Timer"
icon = 'hud.dmi' //Its icon file
icon_state = "dn"
screen_loc = "6,11" //Were it shows up on the screen
Click() //When you click it
usr.Get_dntime() // #2-TO HERE!!!!!!!
mob/proc/Get_dntime()
for(var/area/outside/A in loc)
usr<<"[A.min]:[A.sec]"

Try that, oughta work.
In response to AJX
It will, but it won't work good. No put usr in login, ugh (except in Login as long as you don't change the mob, and Click, and DblClick)
In response to Mysame
Mysame wrote:
It will, but it won't work good. No put usr in login, ugh (except in Login as long as you don't change the mob, and Click, and DblClick)

From my own experience, usr in Login assumes that there is a client, while src does not. If people log in and out while the login proc is excuting, say adding a hud, you're going to get runtimes if client is assumed and the person has logged out already. Other than that I'm not sure about non-interchangable examples because NPCs don't log in, right?