SphereCommunity

Full Version: @timer question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i have looked everywhere to see, but i cant find anything

what i need to know is if there is some way to see how many seconds are left in the @timer on an item so i can display @dclick of the item.

Code:
[ITEMDEF i_my_item]
id=i_gravestone_18

on=@dclick
if (<tag0.used> == 1)
src.sysmessage There are <timer> seconds left until this item can be used again
return 1
else
tag.used 1
timer 30
endif

on=@timer
tag.used 0

i want to display the seconds left until @timer fires where i have <time>
Doesn't <timer> shows how many seconds are left ?_? I don't understand Shock
oh really? damn i just made that up, i didnt know lol

ok, next question about my timer, say i wanted to do a countdown in a sysmessage firing every second without resetting the timer ,how would u suggest i managed that?
Code:
[function f_countdown]
if <argn> > 0
   sysmessage <argn>
   timerf 1,f_countdown <eval <argn> - 1 >
else
   sysmessage boom
endif
yeah i didnt something similar but havent tested it yet, its pretty close to that, actually urs is alot better than mine lol, but i was hoping it worked, if yours does i will assume for now mine does as well

i am having a another issue tho

seems that using nested areadefs have limitations, for instance if i use a function to send messages to all clients in the parent area, anyone in the child areas do not receive the message, altho imo they are in the parent area still, so should receive the message, however they do not
Bigger area = UID(1)
I think, when you send something to bigger area, you send it everybody in region with UID(1). The smaller ones are ignored, because they have their own UIDs.

If I understand it well, the smaller areas just inherit properties/attributes/(whatever) but they delete a certain space in bigger area and create areas with their own UIDs and from this moment bigger area doesn't exist there, where smaller areas are defined.

That countdown is all yours, hope it works.. Smile
Code:
[ITEMDEF i_my_item]
id=i_gravestone_18

on=@dclick
if (<DMOREY>)
src.sysmessage There are <timer> seconds left until this item can be used again
return 1
else
MOREY=30
timer 1
endif

on=@timer
if (<dmorey> > 0)
morey -=1
message <dmorey>
timer 1
else
timer -1
endif
return 1
Reference URL's