ID:169092
 
I suck at coding so I need to know how to make a like a death proc for pvp where whoever dies is returned to the starting point with full health I can fill in the location and hp myself
If you suck read the Dream Maker guide.
/****************************************************
*Forum-Post Reply
*Authour:Caine / -www.dantom.com-
****************************************************/

#define void null
#define DEBUG
/mob
{
/mob/proc/Die(void);
/mob/var
{
health;
max_health;
};
/mob/Die(void)
{
if(health<=0)
{
if(src.client)
{
src<<"Your time in the mortal realm is at its end.";
src.Move(locate(/turf/init_turf),NORTH);
//fill in here
return (TRUE);
};
else del(src)
return (FALSE);
};
};
};
/turf
{
/turf/init_turf //place on of these on the map.
};
Try and read the tutorials at http://www.byondscape.com

but ill try and help you.
Dont copy and paste this, learn from it. Plus youll get errors 'Inconsistent indentation' =D
mob/var
spawnx //spawn x location
spawny
spawnz
hp=10//health
mhp=10//max health
proc
Die()
if(src.hp <=0)//if there hp is less than zero
src.hp = src.mhp
src.loc=locate(src.spawnx,src.spawny,src.spawnz)//ull have to make their spawn point if you want their spawn point to change.
else
return
Set_Spawn_Point()
src.spawnx = src.x
src.spawnz = src.z
src.spawny = src.y
verb
Set_Spawn()
usr.Set_Spawn_Point()

That should help you. Try reading byondscape tutorials.
In response to Prjct_Caine
right well thanks I'm not sure how to do that fancy smanshy box thing but here's what I'm trying to do


mob
proc
deathcheck()
if(src.HP<= 0)
src << "You died"
src.HP = 30
src.loc=locate(59,53,1)
In response to Obiare
The fancy box is dm tags, like your normal bold tag <.b> except it's <.dm>. (without the periods).

About your code, if you want people to have diffrent hp, then i suggest you use:

mob/var
hp=30
maxhp=30

mob
proc
deathcheck()
if(src.hp<=0)
src<<"You have died."
src.hp = src.maxhp// if the user gains more hp as he levels, this will be useful.
loc = locate(1,1,1)// place the location here


Well, that's as simple as it gets. I suggest you start reading stuff off of the dm guide, such as vars and procs.
I also suggest you study the other replies.
In response to Obiare
mob
proc
deathcheck()
if(src.HP< 1)
src << "You died"
src.HP = 30
src.loc=locate(59,53,1)


You had if(src.HP<=0) that would then mean they would have to hit 0 or lower, when you can simply use if(src.HP<1) which then assumes once the HP variable has dropped below 1 it takes its action, nothing major.

that deathcheck also seems to work however you may want it to just simply be

proc
deathcheck()
if(src.HP< 1)
src << "You died"
src.HP = 30
src.loc=locate(59,53,1)

That way you are able to call it by the use of the simple deathcheck()