ID:177548
![]() Aug 27 2002, 9:14 pm
|
|
How would I make it so when you build an object it adds 5 gold every 30 secs but cannot pass the maxgold??? When it reaches the limit it just stops until there is enough room again or the maxgold is higher...
|
Ok, i see a problem here, you never actaully think up much code, you are always on the forums asking for a way to do something, you say you have created games but you are always asking for code, its really starting to bug me... Think before you post.
|
Siientx wrote:
mob Bad form: These procs belong to the mob, so use src, not usr. usr will cease to be valid after the sleep. Further bad form: Your gold_mine() proc is in an infinite recursion. The last two lines should read:
spawn(200) gold_mine()
Lummox JR |
Bah, try something for yourself for once...
usr.gold = min(usr.gold+5, usr.maxgold) |
Garthor wrote:
Bah, try something for yourself for once... Right, but remember, usr is only valid for the life of the verb. The mine needs to keep track of who created it, and give gold to them. Lummox JR |
proc
gold_mine()
usr.gold += 20
usr.goldcheck()
sleep(200)
usr.gold_mine()
goldcheck()
if(usr.gold >= usr.maxgold)
usr.gold = usr.maxgold
else
..()
verb
make_mine()
new/obj/mine(usr.loc)
spawn() usr.gold_mine()