Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Apothem

Respawn terminates scripts

Recommended Posts

Okay, this script works unless either player 1 or 2 dies. Then the script watching the respective player is terminated, and no matter what i've tried to do to get them back up, nothing happens. Any suggestions?
(script 101 is the health checker for player one and script 104 is for player 2)

#include "zcommon.acs" 
int a; 
int b; 
int c; 
int e; 
int g; 
int h; 
int j; 
int schk; 
int l; 
int soldhp; 
int oldhp; 
int sdmg; 
int shielddamaged; 
int shieldhp; 
int shielddmg; 
int Atmprechrg; 
int oshield; 
int plyrI; 
int plyrII; 
int maploaded; 

//BEGIN Player 2 variables 
int Atmprechrga; 
int schka; 
int soldhpa; 
int oldhpa; 
int sdmga; 
int shielddamageda; 
int shieldhpa; 
int shielddmga; 
int oshielda; 
int aa; 
int ba; 
int ea; 

Script 1 ENTER 
{ 
if (plyrI == 1) 
{ 
acs_execute(101,0,0,0,0); 
plyrI = 0; 
} 
if (plyrII == 1) 
{ 
Acs_execute(104,0,0,0,0); 
plyrII = 0; 
} 
delay(2); 
restart; 
} 

Script 2 (void) 
{ 
Damagething(20); 
} 

Script 3 RESPAWN 
{ 
if (playernumber() == 1 ) 
{ 
printbold(s:"Player 2 died!"); 
shieldhpa = 100; 
oldhpa = GetActorProperty(1338, APROP_Health); 
acs_execute(104,0,0,0,0); 
plyrII = 1; 
} 

if (playernumber() == 0) 
{ 
printbold(s:"Player 1 died!"); 
shieldhp = 100; 
oldhp = GetActorProperty(1337, APROP_Health); 
acs_execute(101,0,0,0,0); 
plyrI = 1; 
} 
} 

Script 4 ENTER 
{ 
Thing_ChangeTID (0, 1337+Playernumber()); 
shieldhp = 100; 
oldhp = GetActorProperty(1337, APROP_Health); 
acs_executealways(101,0,0,0,0); 
shieldhpa = 100; 
oldhpa = GetActorProperty(1338, APROP_Health); 
acs_executealways(104,0,0,0,0); 
maploaded = 1; 
} 

Share this post


Link to post

*bump just for the heck of it* There, probelm sovled, should be also easier to read, took out all the unneeded things

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×