ID:261297
 
Recriuter
icon='R.dmi'
verb
Talk()
set name = "Talk"
set category = "Social Commands"
set src in oview(1)
switch(input("Shall I heal you?") in list("Yes","No"))
if("Yes")
usr << "You Healed, No go back to war soldier"
if("No")
usr << "Leave Before I Have To Make You"
density=1


This is my code so far, what must i add so that the recriter can heal you? any example would be great
usr.health+=[somenumberhere]
In response to Nadrew
thanks, but i need the health to equal the max health and not just + other wise people will just keep adding health.
mob/var/health = 50
mob/var/maxhealth = 50
mob/proc/Heal(var/healamount as num,var/target as mob)
var/healed = 0 as num
if(target.health + healamount <= target.maxhealth)
target.health += healamount
healed = healamount
else
healed = target.maxhealth - target.health
target.health = target.maxhealth
return healed
mob/Recruiter/verb/Heal()
set src in oview(1)
if(alert(usr,"Do you want to be healed?","Are you sure?","Yes","No") == "Yes")
usr << "You have been healed for [Heal(rand(7,13),usr)] health."
usr.oview() << "[usr] has been healed."
else
usr << "Okay. Come back any time!"

Take a look at that.
Wouldnt this work?

Recriuter
icon='R.dmi'
verb
Talk()
set name = "Talk"
set category = "Social Commands"
set src in oview(1)
switch(input("Shall I heal you?") in list("Yes","No"))
if("Yes")
usr.Hp=MHP
usr << "You Healed, No go back to war soldier"
if("No")
usr << "Leave Before I Have To Make You"
density=1


In response to Super saiyan3
usr.Health=usr.Maxhealth
In response to Nadrew
Thank you very much.