ID:178532
 
How would i make a medic code that when u are in view (2)

you can heal them and their health go to 100 and it tells them who healed you.
ShadowSiientx wrote:
How would i make a medic code that when u are in view (2)

you can heal them and their health go to 100 and it tells them who healed you.

mob/verb/heal(mob/M in oview(2))
M.health = M.max_health//max healt heal
M << "you were healed by [usr]"//tell the person that got healed
usr << "you healed [M]"
mob/Medic
verb/Heal(mob/M in oview(2))
while(M.HP<=M.HP+100)
M.HP+=rand(1,10)
sleep(10)
In response to Sariat

ShadowSiientx wrote:
How would i make a medic code that when u are in view (2)

you can heal them and their health go to 100 and it tells them who healed you.

mob/verb/heal(mob/M in oview(2))
M.health = M.max_health//max healt heal
M << "you were healed by [usr]"//tell the person that got healed
usr << "you healed [M]"

that would take there health up 2 the maxhealth not 100 unless it was 100.
it would be,

mob/verb/heal(mob/M in oview(2))
M.health += 100
M << "you have been healed by [src]"
if("M.health = M.max_health")
M << "[src] tried to heal you but you are at full health already"
src << "[M] is already at full health"

hopes that sorts out ur code.
In response to Super vivi
Super vivi wrote:
ShadowSiientx wrote:
How would i make a medic code that when u are in view (2)

you can heal them and their health go to 100 and it tells them who healed you.

mob/verb/heal(mob/M in oview(2))
M.health = M.max_health//max healt heal
M << "you were healed by [usr]"//tell the person that got healed
usr << "you healed [M]"

that would take there health up 2 the maxhealth not 100 unless it was 100.
it would be,

mob/verb/heal(mob/M in oview(2))
M.health += 100
M << "you have been healed by [src]"
if("M.health = M.max_health")
M << "[src] tried to heal you but you are at full health already"
src << "[M] is already at full health"

hopes that sorts out ur code.

ACTUALLY, both of you are wrong. Your code there ADDS 100 to the health, not sets it to 100. Just take out the plus in <nobr><code>M.health += 100</nobr></code> and it should be fine.

-Rcet