ID:150238
 
I need a give money verb like the one in life story are a drop gold one ike morte i need the drop god more tho if some one could write it out are say how do do it please do thanks
Rollerc wrote:
I need a give money verb like the one in life story are a drop gold one ike morte i need the drop god more tho if some one could write it out are say how do do it please do thanks

mob
verb
give_gold(mob/M as mob in oview())
var/numgold=input("How much to give?","Gold")
M.gold+=numgold
In response to Air _King
Well that code would lead to alot of negitive numbers try:

mob/verb/Give_Gold(mob/M as mob in oview())
var/Ammount = input("How much?")as num
if(usr.Gold<Ammount)
usr<<"You don't have enough gold"
else
usr.Gold-=Ammount
M.Gold+=Ammount
M<<"[usr] gave you [ammount] gold piece\s"


That should work.
In response to Nadrew
Nadrew wrote:
Well that code would lead to alot of negitive numbers try:

> mob/verb/Give_Gold(mob/M as mob in oview())
> var/Ammount = input("How much?")as num
> if(usr.Gold<Ammount)
> usr<<"You don't have enough gold"
> else
> usr.Gold-=Ammount
> M.Gold+=Ammount
> M<<"[usr] gave you [ammount] gold piece\s"
>

That should work.

Silly me. gotta think next time.