#include "opt.pst"
#include "npcanyp.pst"
int Rule = 1;
int RoundTime = 99;
int PlayerSpawn = 123;
int PlayerSpawnDir = 180;
int PlayerWeapon = 8;
int PlayerWeapon2 = 3;
int PlayerHP = GetJuedingAnyHP();


hjsdnsdmn(int fd,int sjd){
for(i=fd; i<=sjd; i++){	
if(GetTeam(i)==2 &&  GetHP(i)>=0){
Perform(i, "use", 35);
}}}

OnUpdate()
{	
	player = GetAnyChar("player");

if (GetHP(player)>0 && player > 0 && trg>1 && trg<=4) 
{
playerhp = GetHP(player);Save();
}

	now = GetGameTime();
	if (player < 0)
	{
		return 0;
	}

if(trg>y)
{
z=trg-1;y=trg;Save();
}
	if(trg>4 && now > timer)
	{
GameOver(1);
        }

	if(s1==0)
	{
               PlayerPerform("say", "Now LoadingĦAPlease Wait.....");
               PlayerPerform("say", "Now LoadingĦAPlease Wait.....");
	       Loadnpc();s1=1;timer = now+3;
        }

	if(s==0 && s1==1 && now > timer)
	{
	       Load();s1=2;timer = now+1;
        }

	if(s==0 && s1==2 && now > timer)
	{
	       trg++;s=1;timer = now+1;
        }

	if(trg==1 && now > timer)
	{
	       AddNPC("1");
	       AddNPC("2");
	      trg++;
	       timer = now+5;	
        }
	if(trg==2 && now > timer &&  GetHP(c1)<=0 &&  GetHP(c2)<=0)
	{
	       AddNPC("3");
	       AddNPC("4");
	      trg++;
	       timer = now+5;
        }
	if(trg==3 && now > timer &&  GetHP(c3)<=0 &&  GetHP(c4)<=0)
	{
	       AddNPC("5");
	       AddNPC("6");
	      trg++;
	       timer = now+5;
        }

if (now > timer && trg==4 &&  GetHP(c6)<=0 &&  GetHP(c5)<=0) 
{
PlayerPerform("say", "You Win.....");trg=6;
npchp1=500;npchp2=500;npchp3=500;
npchp4=500;npchp5=500;npchp6=500;
playerhp=10000;Savenpc();Save();timer = now+3;
}

if (now > timer && trg==6) 
{
GameOver(1);
}

if (GetHP(player)<=0 && player > 0) 
{GameOver(-1);playerhp=10000;Save();}

if ((c1 > 0 || c2>0) && trg>1 && trg<=2 && s==1) {npchp1=GetHP(c1);npchp2=GetHP(c2);Savenpc();}
if ((c3 > 0 || c4>0) && trg>2 && trg<=3 && s==1) {npchp3=GetHP(c3);npchp4=GetHP(c4);Savenpc();}
if ((c5 > 0 || c6>0) && trg>3 && trg<=4 && s==1) {npchp5=GetHP(c5);npchp6=GetHP(c6);Savenpc();}

        NpcGetAnyCharGet();
}