ID:261837
 
...how do i make it so you HAVE to save 20$ to be able to buy a 'bunny2' ? i tried the.. if(usr.cash >=20) thing but it said proc not alowed inside another proc or something. Thank-Q!


mob
bunny2
var/Owner
verb
Adopt()
if(src.Owner)
usr << "This has an owner!"
else
set src in oview(1)
usr.cash = (usr.cash - 20)
src.Owner = usr.ckey
usr.pet = src //make src as the users pet.
usr << "You adopted a bunny2!"
Check()
set src in oview()
if(src.Owner)
usr << "This pet belongs to [src.Owner]."
else
usr << "This pet is wild."
icon = 'pet.dmi'
icon_state = "bunny2"
<code>Adopt() set src in oview(1) //Should always be at the beginning of the verb. No matter where it is, it applies to the ENTIRE verb; not just what's after it! if(src.Owner) usr << "This has an owner!" else if (usr.cash>=20) usr.cash = (usr.cash - 20) src.Owner = usr.ckey usr.pet = src //make src as the users pet. usr << "You adopted a bunny2!" else usr << "You don't have enough cash to adopt [src]. (You need $20, but only have $[usr.cash].)</code>

Changes in bold.
In response to Crispy
YES! THANK YOU SO MUCH CRISPY ^_^.