ID:178533
 
I would like to know how I could make this code better by having it so player see that they are being attacked but not everyone else. Here is the code:

Login()
icon_state = gender
..()


proc
DeathCheck()
if (Health <= 0)
loc = locate(2,2,2)
Health = MaxHealth

verb
Fight(mob/M as mob in oview(1))
set category = "Actions"
usr << "You are attacking [M]"
var/damage = Strength
usr << "for [damage] damage!"
M:Health -= damage
usr.Exp+=1
usr.gold+=10
if(usr.Health<=0)
src.Health=src.MaxHealth
src.loc=locate(2,2,2)//Change these numbers to the location you want the defeated person to go after he/she dies
Levelup()//This calls the Levelup proc as defined in the other file
Statup()
M:DeathCheck()

DeathCheck()

turf
icon = 'grass.dmi'


mob
Gang_Member
icon = 'mob.dmi'
Fight(mob/M as mob in oview(1))
DeathCheck()
if (Health <= 0)
del(src)
when you use the USR << code only the person playing can see what the text sez.