#library "dnzfunc"
#include "zcommon.acs"

global int 1: barricade[];
global int 2: zombspawns[];
global int 3: zombspawnssector[];
global int 4: barrdestory[];
global int 10: P1PerkBought[];
global int 11: P1PerkBoughtname[];
global int 12: P2PerkBought[];
global int 13: P2PerkBoughtname[];
global int 14: Archvilespawn[];
global int 15: Archvilesector[];
int level;int buildstage = 0; int buildpart1;
int buildpart2; int buildpart3; int buildpart4;
int doublepoints; int insta = 0; int UAmmo = 0;
int P1QR; int P2QR; int pointsp1; int pointsp2; int menupointsp1; int menupointsp2; 
int P1kills; int P2kills; int enemiesallowed;
bool MenuactiveP1 = false; int enemycount; int spawnedmonsters;
int gameover; int power; int P1DT = 0; int P1SS = 0; int P1MK = 0; int P2MK = 0; int P2SS = 0;
int P2DT = 0; int P1SC = 0; int P2SC = 0;int P1JN = 0; int P1PHD = 0; int P2PHD = 0;
int P2JN = 0; int P1SU = 0; int p2SU = 0; int p1QRbuy = 0; int P1DS = 0;
int P2DS = 0; bool MenuactiveP2 = false;
int minutes; int seconds; int Timeon; int timetowaitP2; int timetowaitP1;
int p2QRbuy = 0; int roundover = 0;  int wavenumber = 0;
int bonfiresale = 0; int moneyneeded = 0; int weapontopap;
int p1death = 0; int p2death = 0; int Newvoice = 0;
str normalweaponp1;	str normalweaponp2;		
str papweaponp1; str papweaponp2;	
int P1claysBought = 0; int P2claysBought = 0;
int abletopapp1; int abletopapp2; int spawntime; int P1DTPlace;
int P1SCPlace; int P1JNPlace; int P1QRPlace; int P1SUPlace; 
int P1DSPlace; int P1PHPlace; int P1SSPlace; int P2DTPlace;
int P2SCPlace; int P2JNPlace; int P2QRPlace; int P2SUPlace; 
int P2DSPlace; int P2PHPlace; int P2SSPlace; int P1MKplace;
int P2MKPlace;
int perksnotgonep1; int perksnotgonep2; int waveInProgress = 0;
str takeweaponp1;	str giveweaponp1;	str giveweaponp2;	str takeweaponp2;
int archvilespawned = 0; int archvilealive = 0;int monsterlimit = 24;
//Voice varbles/////////
int P1voicetalking; int P1kill; int P1power; int P1dog;
int P2voicetalking; int P2kill; int P2power; int P2dog;
//Player Voices/////////
/////P1 Voices////////
script 422 (void)
{
int V1aa;
int V1bb;
int V1cc;
 while(GetActorProperty(1337, APROP_Health)>0)
     { 
	   if(P1voicetalking==0 && P1dog==1)
	   {
		 AmbientSound("P1Voice/dog" ,127); 
		 P1voicetalking = 1; 
		 delay(85);
		 P1dog = 0;
		 P1voicetalking=0; 
	   } 
	   if(P1voicetalking==0 && P1power==1)
	   {
	     V1cc = random(1,2);
		 if(V1cc==1){delay(100);AmbientSound("P1Voice/nopower1" ,127); P1voicetalking = 1; delay(85);P1power = 0;P1voicetalking=0; }
		 else if(V1cc==2){delay(100);AmbientSound("P1Voice/nopower2" ,127); P1voicetalking = 1; delay(45);P1power = 0;P1voicetalking=0; }
	   }
	   if(P1voicetalking==0 && P1kill==1)
	   {
	     V1aa = random(1,5);
		if(V1aa==5)
		{
		 V1bb = random(1,5);
		 if(V1bb==1){AmbientSound("P1Voice/Kill1" ,127);P1voicetalking = 1; delay(45);P1kill = 0; P1voicetalking=0;}
		 else if(V1bb==2){AmbientSound("P1Voice/Kill2" ,127);P1voicetalking = 1; delay(75);P1kill = 0; P1voicetalking=0;}
		 else if(V1bb==3){AmbientSound("P1Voice/Kill3" ,127);P1voicetalking = 1; delay(45);P1kill = 0; P1voicetalking=0;}	
		 else if(V1bb==4){AmbientSound("P1Voice/KnifeKill1" ,127);P1voicetalking = 1; delay(45);P1kill = 0; P1voicetalking=0;}	
		 else if(V1bb==5){AmbientSound("P1Voice/KnifeKill2" ,127);P1voicetalking = 1; delay(45);P1kill = 0; P1voicetalking=0;}		
		}
		 P1kill = 0;
        }
		delay(1);
      }
}
/////P2 Voices////////
script 423 (void)
{
int V2aa;
int V2bb;
int V2cc;
 while(GetActorProperty(1338, APROP_Health)>0)
     { 
	   if(P2voicetalking==0 && P2dog==1)
	   {
		 AmbientSound("P2Voice/dog" ,127); 
		 P2voicetalking = 1; 
		 delay(85);
		 P2dog = 0;
		 P2voicetalking=0; 
	   } 
	   if(P2voicetalking==0 && P2power==1)
	   {
	     V2cc = random(1,2);
		 if(V2cc==1){delay(100);AmbientSound("P2Voice/nopower1" ,127); P2voicetalking = 1; delay(85);P2power = 0;P2voicetalking=0; }
		 else if(V2cc==2){delay(100);AmbientSound("P2Voice/nopower2" ,127); P2voicetalking = 1; delay(45);P2power = 0;P2voicetalking=0; }
	   }
	   if(P2voicetalking==0 && P2kill==1)
	   {
	     V2aa = random(1,5);
		if(V2aa==5)
		{
		 V2bb = random(1,5);
		 if(V2bb==1){AmbientSound("P2Voice/Kill1" ,127);P2voicetalking = 1; delay(45);P2kill = 0; P2voicetalking=0;}
		 else if(V2bb==2){AmbientSound("P2Voice/Kill2" ,127);P2voicetalking = 1; delay(75);P2kill = 0; P2voicetalking=0;}
		 else if(V2bb==3){AmbientSound("P2Voice/Kill3" ,127);P2voicetalking = 1; delay(45);P2kill = 0; P2voicetalking=0;}	
		 else if(V2bb==4){AmbientSound("P2Voice/KnifeKill1" ,127);P2voicetalking = 1; delay(45);P2kill = 0; P2voicetalking=0;}	
		 else if(V2bb==5){AmbientSound("P2Voice/KnifeKill2" ,127);P2voicetalking = 1; delay(45);P2kill = 0; P2voicetalking=0;}		
		}
		 P2kill = 0;
        }
		delay(1);
      }
}
//End VOices////////
//Archvile summon Start///////////////////
script 420 (void)
{
 if(ThingCountSector(T_NONE,666,Archvilesector[1])<1)
        {
         if(enemycount < monsterlimit)
         {
	  if(gameskill()!=2){SpawnSpotForced("Monsterspawner",Archvilespawn[1],666,0);}
	  else if(gameskill()==2){SpawnSpotForced("NaziZombie",Archvilespawn[1],666,0);}
          SetThingSpecial(666, 226, 4);
          enemycount = enemycount + 1;
	      acs_executeAlways(750,0,1,0,0);
        }
       }
	   if(ThingCountSector(T_NONE,666,Archvilesector[2])<1)
        {
         if(enemycount < monsterlimit)
         {
	  if(gameskill()!=2){SpawnSpotForced("Monsterspawner",Archvilespawn[2],666,0);}
	  else if(gameskill()==2){SpawnSpotForced("NaziZombie",Archvilespawn[2],666,0);}
          SetThingSpecial(666, 226, 4);
          enemycount = enemycount + 1;
	      acs_executeAlways(750,0,1,0,0);
        }
       }
}

script 421 (void)
{
 archvilealive = 0;
}
//////////Barricades!!//////////////////////
//monster/////////////////////////////////
script 100 (int monid)
{ 
 if(monid==1)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[1])>0)
    {
    if(barricade[1]==3){barricade[1]=2; SetLineTexture(1, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[1]==2){barricade[1]=1; SetLineTexture(1, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[1]==1){barricade[1]=0; SetLineTexture(1, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (1,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==2)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[2])>0)
    {
    if(barricade[2]==3){barricade[2]=2; SetLineTexture(2, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[2]==2){barricade[2]=1; SetLineTexture(2, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[2]==1){barricade[2]=0; SetLineTexture(2, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (2,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==3)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[3])>0)
    {
    if(barricade[3]==3){barricade[3]=2; SetLineTexture(3, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[3]==2){barricade[3]=1; SetLineTexture(3, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[3]==1){barricade[3]=0; SetLineTexture(3, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (3,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==4)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[4])>0)
    {
    if(barricade[4]==3){barricade[4]=2; SetLineTexture(4, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[4]==2){barricade[4]=1; SetLineTexture(4, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[4]==1){barricade[4]=0; SetLineTexture(4, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (4,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==5)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[5])>0)
    {
    if(barricade[5]==3){barricade[5]=2; SetLineTexture(5, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[5]==2){barricade[5]=1; SetLineTexture(5, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[5]==1){barricade[5]=0; SetLineTexture(5, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (5,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==6)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[6])>0)
    {
    if(barricade[6]==3){barricade[6]=2; SetLineTexture(6, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[6]==2){barricade[6]=1; SetLineTexture(6, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[6]==1){barricade[6]=0; SetLineTexture(6, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (6,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==7)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[7])>0)
    {
    if(barricade[7]==3){barricade[7]=2; SetLineTexture(7, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[7]==2){barricade[7]=1; SetLineTexture(7, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[7]==1){barricade[7]=0; SetLineTexture(7, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (7,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==8)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[8])>0)
    {
    if(barricade[8]==3){barricade[8]=2; SetLineTexture(8, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[8]==2){barricade[8]=1; SetLineTexture(8, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[8]==1){barricade[8]=0; SetLineTexture(8, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (8,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==9)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[9])>0)
    {
    if(barricade[9]==3){barricade[9]=2; SetLineTexture(9, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[9]==2){barricade[9]=1; SetLineTexture(9, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[9]==1){barricade[9]=0; SetLineTexture(9, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (9,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==10)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[10])>0)
    {
    if(barricade[10]==3){barricade[10]=2; SetLineTexture(10, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[10]==2){barricade[10]=1; SetLineTexture(10, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[10]==1){barricade[10]=0; SetLineTexture(10, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (10,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==11)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[11])>0)
    {
    if(barricade[11]==3){barricade[11]=2; SetLineTexture(11, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[11]==2){barricade[11]=1; SetLineTexture(11, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[11]==1){barricade[11]=0; SetLineTexture(11, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (11,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==12)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[12])>0)
    {
    if(barricade[12]==3){barricade[12]=2; SetLineTexture(12, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[12]==2){barricade[12]=1; SetLineTexture(12, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[12]==1){barricade[12]=0; SetLineTexture(12, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (12,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==13)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[13])>0)
    {
    if(barricade[13]==3){barricade[13]=2; SetLineTexture(13, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[13]==2){barricade[13]=1; SetLineTexture(13, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[13]==1){barricade[13]=0; SetLineTexture(13, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (13,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==14)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[14])>0)
    {
    if(barricade[14]==3){barricade[14]=2; SetLineTexture(14, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[14]==2){barricade[14]=1; SetLineTexture(14, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[14]==1){barricade[14]=0; SetLineTexture(14, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (14,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==15)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[15])>0)
    {
    if(barricade[15]==3){barricade[15]=2; SetLineTexture(15, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[15]==2){barricade[15]=1; SetLineTexture(15, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[15]==1){barricade[15]=0; SetLineTexture(15, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (15,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==16)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[16])>0)
    {
    if(barricade[16]==3){barricade[16]=2; SetLineTexture(16, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[16]==2){barricade[16]=1; SetLineTexture(16, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[16]==1){barricade[16]=0; SetLineTexture(16, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (16,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==17)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[17])>0)
    {
    if(barricade[17]==3){barricade[17]=2; SetLineTexture(17, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[17]==2){barricade[17]=1; SetLineTexture(17, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[17]==1){barricade[17]=0; SetLineTexture(17, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (17,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==18)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[18])>0)
    {
    if(barricade[18]==3){barricade[18]=2; SetLineTexture(18, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[18]==2){barricade[18]=1; SetLineTexture(18, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[18]==1){barricade[18]=0; SetLineTexture(18, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (18,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==19)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[19])>0)
    {
    if(barricade[19]==3){barricade[19]=2; SetLineTexture(19, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[19]==2){barricade[19]=1; SetLineTexture(19, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[19]==1){barricade[19]=0; SetLineTexture(19, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (19,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==20)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[20])>0)
    {
    if(barricade[20]==3){barricade[20]=2; SetLineTexture(20, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[20]==2){barricade[20]=1; SetLineTexture(20, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[20]==1){barricade[20]=0; SetLineTexture(20, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (20,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==21)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[21])>0)
    {
    if(barricade[21]==3){barricade[21]=2; SetLineTexture(21, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[21]==2){barricade[21]=1; SetLineTexture(21, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[21]==1){barricade[21]=0; SetLineTexture(21, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (21,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==22)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[22])>0)
    {
    if(barricade[22]==3){barricade[22]=2; SetLineTexture(22, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[22]==2){barricade[22]=1; SetLineTexture(22, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[22]==1){barricade[22]=0; SetLineTexture(22, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (22,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==23)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[23])>0)
    {
    if(barricade[23]==3){barricade[23]=2; SetLineTexture(23, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[23]==2){barricade[23]=1; SetLineTexture(23, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[23]==1){barricade[23]=0; SetLineTexture(23, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (23,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==24)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[24])>0)
    {
    if(barricade[24]==3){barricade[24]=2; SetLineTexture(24, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[24]==2){barricade[24]=1; SetLineTexture(24, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[24]==1){barricade[24]=0; SetLineTexture(24, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (24,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==25)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[25])>0)
    {
    if(barricade[25]==3){barricade[25]=2; SetLineTexture(25, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[25]==2){barricade[25]=1; SetLineTexture(25, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[25]==1){barricade[25]=0; SetLineTexture(25, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (25,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==26)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[26])>0)
    {
    if(barricade[26]==3){barricade[26]=2; SetLineTexture(26, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[26]==2){barricade[26]=1; SetLineTexture(26, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[26]==1){barricade[26]=0; SetLineTexture(26, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (26,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==27)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[27])>0)
    {
    if(barricade[27]==3){barricade[27]=2; SetLineTexture(27, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[27]==2){barricade[27]=1; SetLineTexture(27, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[27]==1){barricade[27]=0; SetLineTexture(27, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (27,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==28)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[28])>0)
    {
    if(barricade[28]==3){barricade[28]=2; SetLineTexture(28, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[28]==2){barricade[28]=1; SetLineTexture(28, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[28]==1){barricade[28]=0; SetLineTexture(28, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (28,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
 else if(monid==29)
 {
    while(ThingCountSector(T_NONE,666,zombspawnssector[29])>0)
    {
    if(barricade[29]==3){barricade[29]=2; SetLineTexture(29, SIDE_FRONT, TEXTURE_middle, "BARR2"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[29]==2){barricade[29]=1; SetLineTexture(29, SIDE_FRONT, TEXTURE_middle, "BARR3"); AmbientSound("HIT",127);delay(75);}
    else if(barricade[29]==1){barricade[29]=0; SetLineTexture(29, SIDE_FRONT, TEXTURE_middle, ""); AmbientSound("HIT",127);Line_SetBlocking (29,0,BLOCKF_MONSTERs);}
    delay(1);
    }
 }
}


//player/////////////////////////////////
script 101 (int barid)
{
 if(barid==1)
 {
  if(barricade[1]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[1]=3; SetLineTexture(1, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (1,BLOCKF_MONSTERs,0); }
  else if(barricade[1]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[1]=3; SetLineTexture(1, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (1,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[1]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[1]=2; SetLineTexture(1, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (1,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[1]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[1]=1; SetLineTexture(1, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (1,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==2)
 {
  if(barricade[2]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[2]=3; SetLineTexture(2, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (2,BLOCKF_MONSTERs,0); }
  else if(barricade[2]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[2]=3; SetLineTexture(2, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (2,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[2]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[2]=2; SetLineTexture(2, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (2,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[2]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[2]=1; SetLineTexture(2, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (2,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==3)
 {
  if(barricade[3]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[3]=3; SetLineTexture(3, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (3,BLOCKF_MONSTERs,0); }
  else if(barricade[3]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[3]=3; SetLineTexture(3, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (3,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[3]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[3]=2; SetLineTexture(3, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (3,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[3]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[3]=1; SetLineTexture(3, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (3,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==4)
 {
  if(barricade[4]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[4]=3; SetLineTexture(4, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (4,BLOCKF_MONSTERs,0); }
  else if(barricade[4]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[4]=3; SetLineTexture(4, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (4,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[4]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[4]=2; SetLineTexture(4, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (4,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[4]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[4]=1; SetLineTexture(4, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (4,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==5)
 {
  if(barricade[5]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[5]=3; SetLineTexture(5, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (5,BLOCKF_MONSTERs,0); }
  else if(barricade[5]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[5]=3; SetLineTexture(5, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (5,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[5]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[5]=2; SetLineTexture(5, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (5,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[5]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[5]=1; SetLineTexture(5, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (5,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==6)
 {
  if(barricade[6]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[6]=3; SetLineTexture(6, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (6,BLOCKF_MONSTERs,0); }
  else if(barricade[6]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[6]=3; SetLineTexture(6, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (6,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[6]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[6]=2; SetLineTexture(6, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (6,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[6]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[6]=1; SetLineTexture(6, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (6,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==7)
 {
  if(barricade[7]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[7]=3; SetLineTexture(7, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (7,BLOCKF_MONSTERs,0); }
  else if(barricade[7]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[7]=3; SetLineTexture(7, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (7,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[7]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[7]=2; SetLineTexture(7, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (7,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[7]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[7]=1; SetLineTexture(7, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (7,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==8)
 {
  if(barricade[8]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[8]=3; SetLineTexture(8, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (8,BLOCKF_MONSTERs,0); }
  else if(barricade[8]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[8]=3; SetLineTexture(8, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (8,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[8]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[8]=2; SetLineTexture(8, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (8,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[8]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[8]=1; SetLineTexture(8, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (8,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==9)
 {
  if(barricade[9]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[9]=3; SetLineTexture(9, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (9,BLOCKF_MONSTERs,0); }
  else if(barricade[9]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[9]=3; SetLineTexture(9, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (9,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[9]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[9]=2; SetLineTexture(9, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (9,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[9]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[9]=1; SetLineTexture(9, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (9,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==10)
 {
  if(barricade[10]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[10]=3; SetLineTexture(10, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (10,BLOCKF_MONSTERs,0); }
  else if(barricade[10]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[10]=3; SetLineTexture(10, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (10,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[10]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[10]=2; SetLineTexture(10, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (10,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[10]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[10]=1; SetLineTexture(10, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (10,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==11)
 {
  if(barricade[11]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[11]=3; SetLineTexture(11, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (11,BLOCKF_MONSTERs,0); }
  else if(barricade[11]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[11]=3; SetLineTexture(11, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (11,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[11]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[11]=2; SetLineTexture(11, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (11,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[11]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[11]=1; SetLineTexture(11, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (11,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==12)
 {
  if(barricade[12]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[12]=3; SetLineTexture(12, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (12,BLOCKF_MONSTERs,0); }
  else if(barricade[12]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[12]=3; SetLineTexture(12, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (12,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[12]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[12]=2; SetLineTexture(12, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (12,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[12]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[12]=1; SetLineTexture(12, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (12,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==13)
 {
  if(barricade[13]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[13]=3; SetLineTexture(13, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (13,BLOCKF_MONSTERs,0); }
  else if(barricade[13]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[13]=3; SetLineTexture(13, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (13,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[13]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[13]=2; SetLineTexture(13, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (13,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[13]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[13]=1; SetLineTexture(13, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (13,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==14)
 {
  if(barricade[14]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[14]=3; SetLineTexture(14, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (14,BLOCKF_MONSTERs,0); }
  else if(barricade[14]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[14]=3; SetLineTexture(14, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (14,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[14]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[14]=2; SetLineTexture(14, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (14,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[14]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[14]=1; SetLineTexture(14, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (14,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==15)
 {
  if(barricade[15]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[15]=3; SetLineTexture(15, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (15,BLOCKF_MONSTERs,0); }
  else if(barricade[15]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[15]=3; SetLineTexture(15, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (15,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[15]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[15]=2; SetLineTexture(15, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (15,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[15]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[15]=1; SetLineTexture(15, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (15,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==16)
 {
  if(barricade[16]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[16]=3; SetLineTexture(16, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (16,BLOCKF_MONSTERs,0); }
  else if(barricade[16]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[16]=3; SetLineTexture(16, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (16,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[16]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[16]=2; SetLineTexture(16, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (16,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[16]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[16]=1; SetLineTexture(16, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (16,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==17)
 {
  if(barricade[17]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[17]=3; SetLineTexture(17, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (17,BLOCKF_MONSTERs,0); }
  else if(barricade[17]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[17]=3; SetLineTexture(17, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (17,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[17]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[17]=2; SetLineTexture(17, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (17,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[17]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[17]=1; SetLineTexture(17, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (17,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==18)
 {
  if(barricade[18]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[18]=3; SetLineTexture(18, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (18,BLOCKF_MONSTERs,0); }
  else if(barricade[18]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[18]=3; SetLineTexture(18, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (18,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[18]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[18]=2; SetLineTexture(18, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (18,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[18]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[18]=1; SetLineTexture(18, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (18,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==19)
 {
  if(barricade[19]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[19]=3; SetLineTexture(19, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (19,BLOCKF_MONSTERs,0); }
  else if(barricade[19]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[19]=3; SetLineTexture(19, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (19,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[19]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[19]=2; SetLineTexture(19, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (19,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[19]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[19]=1; SetLineTexture(19, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (19,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==20)
 {
  if(barricade[20]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[20]=3; SetLineTexture(20, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (20,BLOCKF_MONSTERs,0); }
  else if(barricade[20]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[20]=3; SetLineTexture(20, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (20,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[20]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[20]=2; SetLineTexture(20, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (20,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[20]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[20]=1; SetLineTexture(20, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (20,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==21)
 {
  if(barricade[21]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[21]=3; SetLineTexture(21, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (21,BLOCKF_MONSTERs,0); }
  else if(barricade[21]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[21]=3; SetLineTexture(21, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (21,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[21]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[21]=2; SetLineTexture(21, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (21,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[21]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[21]=1; SetLineTexture(21, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (21,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==22)
 {
  if(barricade[22]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[22]=3; SetLineTexture(22, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (22,BLOCKF_MONSTERs,0); }
  else if(barricade[22]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[22]=3; SetLineTexture(22, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (22,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[22]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[22]=2; SetLineTexture(22, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (22,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[22]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[22]=1; SetLineTexture(22, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (22,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==23)
 {
  if(barricade[23]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[23]=3; SetLineTexture(23, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (23,BLOCKF_MONSTERs,0); }
  else if(barricade[23]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[23]=3; SetLineTexture(23, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (23,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[23]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[23]=2; SetLineTexture(23, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (23,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[23]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[23]=1; SetLineTexture(23, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (23,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==24)
 {
  if(barricade[24]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[24]=3; SetLineTexture(24, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (24,BLOCKF_MONSTERs,0); }
  else if(barricade[24]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[24]=3; SetLineTexture(24, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (24,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[24]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[24]=2; SetLineTexture(24, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (24,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[24]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[24]=1; SetLineTexture(24, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (24,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==25)
 {
  if(barricade[25]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[25]=3; SetLineTexture(25, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (25,BLOCKF_MONSTERs,0); }
  else if(barricade[25]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[25]=3; SetLineTexture(25, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (25,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[25]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[25]=2; SetLineTexture(25, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (25,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[25]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[25]=1; SetLineTexture(25, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (25,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==26)
 {
  if(barricade[26]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[26]=3; SetLineTexture(26, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (26,BLOCKF_MONSTERs,0); }
  else if(barricade[26]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[26]=3; SetLineTexture(26, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (26,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[26]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[26]=2; SetLineTexture(26, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (26,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[26]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[26]=1; SetLineTexture(26, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (26,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==27)
 {
  if(barricade[27]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[27]=3; SetLineTexture(27, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (27,BLOCKF_MONSTERs,0); }
  else if(barricade[27]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[27]=3; SetLineTexture(27, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (27,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[27]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[27]=2; SetLineTexture(27, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (27,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[27]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[27]=1; SetLineTexture(27, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (27,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==28)
 {
  if(barricade[28]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[28]=3; SetLineTexture(28, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (28,BLOCKF_MONSTERs,0); }
  else if(barricade[28]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[28]=3; SetLineTexture(28, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (28,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[28]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[28]=2; SetLineTexture(28, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (28,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[28]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[28]=1; SetLineTexture(28, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (28,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
 else if(barid==29)
 {
  if(barricade[29]==3 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[29]=3; SetLineTexture(29, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (29,BLOCKF_MONSTERs,0); }
  else if(barricade[29]==2 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[29]=3; SetLineTexture(29, SIDE_FRONT, TEXTURE_middle, "BARR1"); Line_SetBlocking (29,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[29]==1 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[29]=2; SetLineTexture(29, SIDE_FRONT, TEXTURE_middle, "BARR2"); Line_SetBlocking (29,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
  else if(barricade[29]==0 && ThingCountSector(T_NONE,666,zombspawnssector[barid])<1){barricade[29]=1; SetLineTexture(29, SIDE_FRONT, TEXTURE_middle, "BARR3"); Line_SetBlocking (29,BLOCKF_MONSTERs,0); acs_execute(777,0,0,0,0); }
 }
}

script 410 (void)
{
 if(P1PerkBought[1]==1)
 {
  if(P1PerkBoughtName[1]=="DT"){P1DTPlace =0.01;}
  if(P1PerkBoughtName[1]=="SC"){P1SCPlace =0.01;}
  if(P1PerkBoughtName[1]=="JN"){P1JNPlace =0.01;}
  if(P1PerkBoughtName[1]=="QR"){P1QRPlace =0.01;}
  if(P1PerkBoughtName[1]=="SU"){P1SUPlace =0.01;}
  if(P1PerkBoughtName[1]=="DS"){P1DSPlace =0.01;}
  if(P1PerkBoughtName[1]=="PH"){P1PHPlace =0.01;}
  if(P1PerkBoughtName[1]=="SS"){P1SSPlace =0.01;}
  if(P1PerkBoughtName[1]=="MK"){P1MKPlace =0.01;}
 }
 if(P1PerkBought[2]==1)
 {
  if(P1PerkBoughtName[2]=="DT"){P1DTPlace =0.04;}
  if(P1PerkBoughtName[2]=="SC"){P1SCPlace =0.04;}
  if(P1PerkBoughtName[2]=="JN"){P1JNPlace =0.04;}
  if(P1PerkBoughtName[2]=="QR"){P1QRPlace =0.04;}
  if(P1PerkBoughtName[2]=="SU"){P1SUPlace =0.04;}
  if(P1PerkBoughtName[2]=="DS"){P1DSPlace =0.04;}
  if(P1PerkBoughtName[2]=="PH"){P1PHPlace =0.04;}
  if(P1PerkBoughtName[2]=="SS"){P1SSPlace =0.04;}
  if(P1PerkBoughtName[2]=="MK"){P1MKPlace =0.04;}
 }
 if(P1PerkBought[3]==1)
 {
  if(P1PerkBoughtName[3]=="DT"){P1DTPlace =0.07;}
  if(P1PerkBoughtName[3]=="SC"){P1SCPlace =0.07;}
  if(P1PerkBoughtName[3]=="JN"){P1JNPlace =0.07;}
  if(P1PerkBoughtName[3]=="QR"){P1QRPlace =0.07;}
  if(P1PerkBoughtName[3]=="SU"){P1SUPlace =0.07;}
  if(P1PerkBoughtName[3]=="DS"){P1DSPlace =0.07;}
  if(P1PerkBoughtName[3]=="PH"){P1PHPlace =0.07;}
  if(P1PerkBoughtName[3]=="SS"){P1SSPlace =0.07;}
  if(P1PerkBoughtName[3]=="MK"){P1MKPlace =0.07;}
 }
 if(P1PerkBought[4]==1)
 {
  if(P1PerkBoughtName[4]=="DT"){P1DTPlace =0.10;}
  if(P1PerkBoughtName[4]=="SC"){P1SCPlace =0.10;}
  if(P1PerkBoughtName[4]=="JN"){P1JNPlace =0.10;}
  if(P1PerkBoughtName[4]=="QR"){P1QRPlace =0.10;}
  if(P1PerkBoughtName[4]=="SU"){P1SUPlace =0.10;}
  if(P1PerkBoughtName[4]=="DS"){P1DSPlace =0.10;}
  if(P1PerkBoughtName[4]=="PH"){P1PHPlace =0.10;}
  if(P1PerkBoughtName[4]=="SS"){P1SSPlace =0.10;}
  if(P1PerkBoughtName[4]=="MK"){P1MKPlace =0.10;}
 }
 if(P1PerkBought[5]==1)
 {
  if(P1PerkBoughtName[5]=="DT"){P1DTPlace =0.13;}
  if(P1PerkBoughtName[5]=="SC"){P1SCPlace =0.13;}
  if(P1PerkBoughtName[5]=="JN"){P1JNPlace =0.13;}
  if(P1PerkBoughtName[5]=="QR"){P1QRPlace =0.13;}
  if(P1PerkBoughtName[5]=="SU"){P1SUPlace =0.13;}
  if(P1PerkBoughtName[5]=="DS"){P1DSPlace =0.13;}
  if(P1PerkBoughtName[5]=="PH"){P1PHPlace =0.13;}
  if(P1PerkBoughtName[5]=="SS"){P1SSPlace =0.13;}
  if(P1PerkBoughtName[5]=="MK"){P1MKPlace =0.13;}
 }
 if(P1PerkBought[6]==1)
 {
  if(P1PerkBoughtName[6]=="DT"){P1DTPlace =0.16;}
  if(P1PerkBoughtName[6]=="SC"){P1SCPlace =0.16;}
  if(P1PerkBoughtName[6]=="JN"){P1JNPlace =0.16;}
  if(P1PerkBoughtName[6]=="QR"){P1QRPlace =0.16;}
  if(P1PerkBoughtName[6]=="SU"){P1SUPlace =0.16;}
  if(P1PerkBoughtName[6]=="DS"){P1DSPlace =0.16;}
  if(P1PerkBoughtName[6]=="PH"){P1PHPlace =0.16;}
  if(P1PerkBoughtName[6]=="SS"){P1SSPlace =0.16;}
  if(P1PerkBoughtName[6]=="MK"){P1MKPlace =0.16;}
 }
 if(P1PerkBought[7]==1)
 {
  if(P1PerkBoughtName[7]=="DT"){P1DTPlace =0.19;}
  if(P1PerkBoughtName[7]=="SC"){P1SCPlace =0.19;}
  if(P1PerkBoughtName[7]=="JN"){P1JNPlace =0.19;}
  if(P1PerkBoughtName[7]=="QR"){P1QRPlace =0.19;}
  if(P1PerkBoughtName[7]=="SU"){P1SUPlace =0.19;}
  if(P1PerkBoughtName[7]=="DS"){P1DSPlace =0.19;}
  if(P1PerkBoughtName[7]=="PH"){P1PHPlace =0.19;}
  if(P1PerkBoughtName[7]=="SS"){P1SSPlace =0.19;}
  if(P1PerkBoughtName[7]=="MK"){P1MKPlace =0.19;}
 }
 if(P1PerkBought[8]==1)
 {
  if(P1PerkBoughtName[8]=="DT"){P1DTPlace =0.22;}
  if(P1PerkBoughtName[8]=="SC"){P1SCPlace =0.22;}
  if(P1PerkBoughtName[8]=="JN"){P1JNPlace =0.22;}
  if(P1PerkBoughtName[8]=="QR"){P1QRPlace =0.22;}
  if(P1PerkBoughtName[8]=="SU"){P1SUPlace =0.22;}
  if(P1PerkBoughtName[8]=="DS"){P1DSPlace =0.22;}
  if(P1PerkBoughtName[8]=="PH"){P1PHPlace =0.22;}
  if(P1PerkBoughtName[8]=="SS"){P1SSPlace =0.22;}
  if(P1PerkBoughtName[8]=="MK"){P1MKPlace =0.22;}
 }
 if(P1PerkBought[9]==1)
 {
  if(P1PerkBoughtName[9]=="DT"){P1DTPlace =0.25;}
  if(P1PerkBoughtName[9]=="SC"){P1SCPlace =0.25;}
  if(P1PerkBoughtName[9]=="JN"){P1JNPlace =0.25;}
  if(P1PerkBoughtName[9]=="QR"){P1QRPlace =0.25;}
  if(P1PerkBoughtName[9]=="SU"){P1SUPlace =0.25;}
  if(P1PerkBoughtName[9]=="DS"){P1DSPlace =0.25;}
  if(P1PerkBoughtName[9]=="PH"){P1PHPlace =0.25;}
  if(P1PerkBoughtName[9]=="SS"){P1SSPlace =0.25;}
  if(P1PerkBoughtName[9]=="MK"){P1MKPlace =0.25;}
 }
}

script 413 (void)
{
 if(P2PerkBought[1]==1)
 {
  if(P2PerkBoughtName[1]=="DT"){P2DTPlace =0.01;}
  if(P2PerkBoughtName[1]=="SC"){P2SCPlace =0.01;}
  if(P2PerkBoughtName[1]=="JN"){P2JNPlace =0.01;}
  if(P2PerkBoughtName[1]=="QR"){P2QRPlace =0.01;}
  if(P2PerkBoughtName[1]=="SU"){P2SUPlace =0.01;}
  if(P2PerkBoughtName[1]=="DS"){P2DSPlace =0.01;}
  if(P2PerkBoughtName[1]=="PH"){P2PHPlace =0.01;}
  if(P2PerkBoughtName[1]=="SS"){P2SSPlace =0.01;}
 }
 if(P2PerkBought[2]==1)
 {
  if(P2PerkBoughtName[2]=="DT"){P2DTPlace =0.04;}
  if(P2PerkBoughtName[2]=="SC"){P2SCPlace =0.04;}
  if(P2PerkBoughtName[2]=="JN"){P2JNPlace =0.04;}
  if(P2PerkBoughtName[2]=="QR"){P2QRPlace =0.04;}
  if(P2PerkBoughtName[2]=="SU"){P2SUPlace =0.04;}
  if(P2PerkBoughtName[2]=="DS"){P2DSPlace =0.04;}
  if(P2PerkBoughtName[2]=="PH"){P2PHPlace =0.04;}
  if(P2PerkBoughtName[2]=="SS"){P2SSPlace =0.04;}
 }
 if(P2PerkBought[3]==1)
 {
  if(P2PerkBoughtName[3]=="DT"){P2DTPlace =0.07;}
  if(P2PerkBoughtName[3]=="SC"){P2SCPlace =0.07;}
  if(P2PerkBoughtName[3]=="JN"){P2JNPlace =0.07;}
  if(P2PerkBoughtName[3]=="QR"){P2QRPlace =0.07;}
  if(P2PerkBoughtName[3]=="SU"){P2SUPlace =0.07;}
  if(P2PerkBoughtName[3]=="DS"){P2DSPlace =0.07;}
  if(P2PerkBoughtName[3]=="PH"){P2PHPlace =0.07;}
  if(P2PerkBoughtName[3]=="SS"){P2SSPlace =0.07;}
 }
 if(P2PerkBought[4]==1)
 {
  if(P2PerkBoughtName[4]=="DT"){P2DTPlace =0.10;}
  if(P2PerkBoughtName[4]=="SC"){P2SCPlace =0.10;}
  if(P2PerkBoughtName[4]=="JN"){P2JNPlace =0.10;}
  if(P2PerkBoughtName[4]=="QR"){P2QRPlace =0.10;}
  if(P2PerkBoughtName[4]=="SU"){P2SUPlace =0.10;}
  if(P2PerkBoughtName[4]=="DS"){P2DSPlace =0.10;}
  if(P2PerkBoughtName[4]=="PH"){P2PHPlace =0.10;}
  if(P2PerkBoughtName[4]=="SS"){P2SSPlace =0.10;}
 }
 if(P2PerkBought[5]==1)
 {
  if(P2PerkBoughtName[5]=="DT"){P2DTPlace =0.13;}
  if(P2PerkBoughtName[5]=="SC"){P2SCPlace =0.13;}
  if(P2PerkBoughtName[5]=="JN"){P2JNPlace =0.13;}
  if(P2PerkBoughtName[5]=="QR"){P2QRPlace =0.13;}
  if(P2PerkBoughtName[5]=="SU"){P2SUPlace =0.13;}
  if(P2PerkBoughtName[5]=="DS"){P2DSPlace =0.13;}
  if(P2PerkBoughtName[5]=="PH"){P2PHPlace =0.13;}
  if(P2PerkBoughtName[5]=="SS"){P2SSPlace =0.13;}
 }
 if(P2PerkBought[6]==1)
 {
  if(P2PerkBoughtName[6]=="DT"){P2DTPlace =0.16;}
  if(P2PerkBoughtName[6]=="SC"){P2SCPlace =0.16;}
  if(P2PerkBoughtName[6]=="JN"){P2JNPlace =0.16;}
  if(P2PerkBoughtName[6]=="QR"){P2QRPlace =0.16;}
  if(P2PerkBoughtName[6]=="SU"){P2SUPlace =0.16;}
  if(P2PerkBoughtName[6]=="DS"){P2DSPlace =0.16;}
  if(P2PerkBoughtName[6]=="PH"){P2PHPlace =0.16;}
  if(P2PerkBoughtName[6]=="SS"){P2SSPlace =0.16;}
 }
 if(P2PerkBought[7]==1)
 {
  if(P2PerkBoughtName[7]=="DT"){P2DTPlace =0.19;}
  if(P2PerkBoughtName[7]=="SC"){P2SCPlace =0.19;}
  if(P2PerkBoughtName[7]=="JN"){P2JNPlace =0.19;}
  if(P2PerkBoughtName[7]=="QR"){P2QRPlace =0.19;}
  if(P2PerkBoughtName[7]=="SU"){P2SUPlace =0.19;}
  if(P2PerkBoughtName[7]=="DS"){P2DSPlace =0.19;}
  if(P2PerkBoughtName[7]=="PH"){P2PHPlace =0.19;}
  if(P2PerkBoughtName[7]=="SS"){P2SSPlace =0.19;}
 }
 if(P2PerkBought[8]==1)
 {
  if(P2PerkBoughtName[8]=="DT"){P2DTPlace =0.22;}
  if(P2PerkBoughtName[8]=="SC"){P2SCPlace =0.22;}
  if(P2PerkBoughtName[8]=="JN"){P2JNPlace =0.22;}
  if(P2PerkBoughtName[8]=="QR"){P2QRPlace =0.22;}
  if(P2PerkBoughtName[8]=="SU"){P2SUPlace =0.22;}
  if(P2PerkBoughtName[8]=="DS"){P2DSPlace =0.22;}
  if(P2PerkBoughtName[8]=="PH"){P2PHPlace =0.22;}
  if(P2PerkBoughtName[8]=="SS"){P2SSPlace =0.22;}
 }
 if(p2PerkBought[9]==1)
 {
  if(p2PerkBoughtName[9]=="DT"){p2DTPlace =0.25;}
  if(p2PerkBoughtName[9]=="SC"){p2SCPlace =0.25;}
  if(p2PerkBoughtName[9]=="JN"){p2JNPlace =0.25;}
  if(p2PerkBoughtName[9]=="QR"){p2QRPlace =0.25;}
  if(p2PerkBoughtName[9]=="SU"){p2SUPlace =0.25;}
  if(p2PerkBoughtName[9]=="DS"){p2DSPlace =0.25;}
  if(p2PerkBoughtName[9]=="PH"){p2PHPlace =0.25;}
  if(p2PerkBoughtName[9]=="SS"){p2SSPlace =0.25;}
  if(p2PerkBoughtName[9]=="MK"){P2MKPlace =0.25;}
 }
}
Script 411 (Void)
{
    acs_execute(422,0,0,0,0);
     while(GetActorProperty(1337, APROP_Health)>0)
     { 
            if(P1DT>0)
            {
            setfont("DT");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 150+playernumber(), CR_UNTRANSLATED, P1DTPlace, 0.86, 1.0);
            }
            if(P1SC>0)
            {
            setfont("SC");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 151+playernumber(), CR_UNTRANSLATED, P1SCPlace, 0.86, 1.0);
            }
            if(P1JN>0)
            {
            setfont("JN");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 152+playernumber(), CR_UNTRANSLATED, P1JNPlace, 0.86, 1.0);
            }
            if(P1QR>0)
            {
            setfont("QR");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 153+playernumber(), CR_UNTRANSLATED, P1QRPlace, 0.86, 1.0);
            }
            if(P1SU>0)
            {
            setfont("SU");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 154+playernumber(), CR_UNTRANSLATED, P1SUPlace, 0.86, 1.0);
            }
            if(P1DS>0)
            {
            setfont("DS");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 155+playernumber(), CR_UNTRANSLATED, P1DSPlace, 0.86, 1.0);
            }
            if(P1PHD>0)
            {
            setfont("PH");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 156+playernumber(), CR_UNTRANSLATED, P1PHPlace, 0.86, 1.0);
            }
            if(P1SS>0)
            {
            setfont("SS");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 157+playernumber(), CR_UNTRANSLATED, P1SSPlace, 0.86, 1.0);
            }
            if(P1MK>0)
            {
            setfont("MK");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 158+playernumber(), CR_UNTRANSLATED, P1MKPlace, 0.86, 1.0);
            }
			delay(1);
	}
}

Script 412 (Void)
{
    acs_execute(423,0,0,0,0);
     while(GetActorProperty(1338, APROP_Health)>0)
     { 
            if(P2DT>0)
            {
            setfont("DT");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 150+playernumber(), CR_UNTRANSLATED, P2DTPlace, 0.86, 1.0);
            }
            if(P2SC>0)
            {
            setfont("SC");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 151+playernumber(), CR_UNTRANSLATED, P2SCPlace, 0.86, 1.0);
            }
            if(P2JN>0)
            {
            setfont("JN");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 152+playernumber(), CR_UNTRANSLATED, P2JNPlace, 0.86, 1.0);
            }
            if(P2QR>0)
            {
            setfont("QR");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 153+playernumber(), CR_UNTRANSLATED, P2QRPlace, 0.86, 1.0);
            }
            if(P2SU>0)
            {
            setfont("SU");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 154+playernumber(), CR_UNTRANSLATED, P2SUPlace, 0.86, 1.0);
            }
            if(P2DS>0)
            {
            setfont("DS");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 155+playernumber(), CR_UNTRANSLATED, P2DSPlace, 0.86, 1.0);
            }
            if(P2PHD>0)
            {
            setfont("PH");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 156+playernumber(), CR_UNTRANSLATED, P2PHPlace, 0.86, 1.0);
            }
            if(P2SS>0)
            {
            setfont("SS");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 157+playernumber(), CR_UNTRANSLATED, P2SSPlace, 0.86, 1.0);
            }
            if(P2MK>0)
            {
            setfont("MK");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 158+playernumber(), CR_UNTRANSLATED, P2MKPlace, 0.86, 1.0);
            }
			delay(1);
	}
}

//PERKS WHY???///////////////////////////////////////////////////
//Doubletap!////////////////////////////////////////////////////////////
Script 200 (void)
{
if(checkinventory("doubletap")==0 && power==1)
{
HudMessage(s:"Press \cfUSE \c-to Buy Doubletap \cf[Cost:2000]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
}
else if(power==0)
{
HudMessage(s:"Turn on the power!";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
}
}

script 201 (void)
{
  if(ActivatorTID()==1337 && P1DT==0 && checkactorinventory(1337,"money") >= 2000 && power==1)
  {
  takeactorinventory(1337,"money",2000);
  giveactorinventory(1337,"doubletap",1);
  P1DT = 1;
   if(P1PerkBought[1]==0){P1PerkBought[1]=1; P1PerkBoughtName[1]="DT";}
   else if(P1PerkBought[2]==0){P1PerkBought[2]=1; P1PerkBoughtName[2]="DT";}
   else if(P1PerkBought[3]==0){P1PerkBought[3]=1; P1PerkBoughtName[3]="DT";}
   else if(P1PerkBought[4]==0){P1PerkBought[4]=1; P1PerkBoughtName[4]="DT";}
   else if(P1PerkBought[5]==0){P1PerkBought[5]=1; P1PerkBoughtName[5]="DT";}
   else if(P1PerkBought[6]==0){P1PerkBought[6]=1; P1PerkBoughtName[6]="DT";}
   else if(P1PerkBought[7]==0){P1PerkBought[7]=1; P1PerkBoughtName[7]="DT";}
   else if(P1PerkBought[8]==0){P1PerkBought[8]=1; P1PerkBoughtName[8]="DT";}
   else if(P1PerkBought[9]==0){P1PerkBought[9]=1; P1PerkBoughtName[9]="DT";}
   acs_execute(410,0,0,0,0);
  }
  else if(ActivatorTID()==1338 && P2DT==0 && checkactorinventory(1338,"money") >= 2000 && power==1)
  {
  takeactorinventory(1338,"money",2000);
  giveactorinventory(1338,"doubletap",1);
  P2DT = 1;
   if(P2PerkBought[1]==0){P2PerkBought[1]=1; P2PerkBoughtName[1]="DT";}
   else if(P2PerkBought[2]==0){P2PerkBought[2]=1; P2PerkBoughtName[2]="DT";}
   else if(P2PerkBought[3]==0){P2PerkBought[3]=1; P2PerkBoughtName[3]="DT";}
   else if(P2PerkBought[4]==0){P2PerkBought[4]=1; P2PerkBoughtName[4]="DT";}
   else if(P2PerkBought[5]==0){P2PerkBought[5]=1; P2PerkBoughtName[5]="DT";}
   else if(P2PerkBought[6]==0){P2PerkBought[6]=1; P2PerkBoughtName[6]="DT";}
   else if(P2PerkBought[7]==0){P2PerkBought[7]=1; P2PerkBoughtName[7]="DT";}
   else if(P2PerkBought[8]==0){P2PerkBought[8]=1; P2PerkBoughtName[8]="DT";}
   else if(P2PerkBought[9]==0){P2PerkBought[9]=1; P2PerkBoughtName[9]="DT";}
   acs_execute(413,0,0,0,0);
  }
}
//Speedcola!////////////////////////////////////////////////////////////
Script 202 (void)
{
if(checkinventory("speedcola")==0 && power==1){HudMessage(s:"Press \cfUSE \c-to buy speedcola \cf[Cost:3000]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);}
else if(power==0)
{HudMessage(s:"Turn on the power!";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);}
}

script 203 (void)
{
  if(ActivatorTID()==1337 && P1SC==0 && checkactorinventory(1337,"money") >= 3000 && power==1)
  {
  takeactorinventory(1337,"money",3000);
  giveactorinventory(1337,"speedcola",1);
  P1Sc = 1;
   if(P1PerkBought[1]==0){P1PerkBought[1]=1; P1PerkBoughtName[1]="SC";}
   else if(P1PerkBought[2]==0){P1PerkBought[2]=1; P1PerkBoughtName[2]="SC";}
   else if(P1PerkBought[3]==0){P1PerkBought[3]=1; P1PerkBoughtName[3]="SC";}
   else if(P1PerkBought[4]==0){P1PerkBought[4]=1; P1PerkBoughtName[4]="SC";}
   else if(P1PerkBought[5]==0){P1PerkBought[5]=1; P1PerkBoughtName[5]="SC";}
   else if(P1PerkBought[6]==0){P1PerkBought[6]=1; P1PerkBoughtName[6]="SC";}
   else if(P1PerkBought[7]==0){P1PerkBought[7]=1; P1PerkBoughtName[7]="SC";}
   else if(P1PerkBought[8]==0){P1PerkBought[8]=1; P1PerkBoughtName[8]="SC";}
   else if(P1PerkBought[9]==0){P1PerkBought[9]=1; P1PerkBoughtName[9]="SC";}
   acs_execute(410,0,0,0,0);
  }
  else if(ActivatorTID()==1338 && P2SC==0 && checkactorinventory(1338,"money") >= 3000 && power==1)
  {
  takeactorinventory(1338,"money",3000);
  giveactorinventory(1338,"speedcola",1);
  P2SC = 1;
   if(P2PerkBought[1]==0){P2PerkBought[1]=1; P2PerkBoughtName[1]="SC";}
   else if(P2PerkBought[2]==0){P2PerkBought[2]=1; P2PerkBoughtName[2]="SC";}
   else if(P2PerkBought[3]==0){P2PerkBought[3]=1; P2PerkBoughtName[3]="SC";}
   else if(P2PerkBought[4]==0){P2PerkBought[4]=1; P2PerkBoughtName[4]="SC";}
   else if(P2PerkBought[5]==0){P2PerkBought[5]=1; P2PerkBoughtName[5]="SC";}
   else if(P2PerkBought[6]==0){P2PerkBought[6]=1; P2PerkBoughtName[6]="SC";}
   else if(P2PerkBought[7]==0){P2PerkBought[7]=1; P2PerkBoughtName[7]="SC";}
   else if(P2PerkBought[8]==0){P2PerkBought[8]=1; P2PerkBoughtName[8]="SC";}
   else if(P2PerkBought[9]==0){P2PerkBought[9]=1; P2PerkBoughtName[9]="SC";}
   acs_execute(413,0,0,0,0);
  }
}
//Juggernog!////////////////////////////////////////////////////////////
Script 204 (void)
{
if(P1JN==0 && activatorTID()==1337 && power==1)
{
HudMessage(s:"Press \cfUSE \c-to Buy Juggernog \cf[Cost:2500]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
}
else if(P2JN==0 && activatorTID()==1338 && power==1)
{
HudMessage(s:"Press \cfUSE \c-to Buy Juggernog \cf[Cost:2500]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
}
else if(power==0)
{
HudMessage(s:"Turn on the power!";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
}
}

script 205 (void)
{
  if(ActivatorTID()==1337 && P1JN==0 && checkactorinventory(1337,"money") >= 2500 && power==1)
  {
  takeactorinventory(1337,"money",2500);
  giveactorinventory(1337,"Juggernog",1);
  P1JN = 1;
   if(P1PerkBought[1]==0){P1PerkBought[1]=1; P1PerkBoughtName[1]="JN";}
   else if(P1PerkBought[2]==0){P1PerkBought[2]=1; P1PerkBoughtName[2]="JN";}
   else if(P1PerkBought[3]==0){P1PerkBought[3]=1; P1PerkBoughtName[3]="JN";}
   else if(P1PerkBought[4]==0){P1PerkBought[4]=1; P1PerkBoughtName[4]="JN";}
   else if(P1PerkBought[5]==0){P1PerkBought[5]=1; P1PerkBoughtName[5]="JN";}
   else if(P1PerkBought[6]==0){P1PerkBought[6]=1; P1PerkBoughtName[6]="JN";}
   else if(P1PerkBought[7]==0){P1PerkBought[7]=1; P1PerkBoughtName[7]="JN";}
   else if(P1PerkBought[8]==0){P1PerkBought[8]=1; P1PerkBoughtName[8]="JN";}
   else if(P1PerkBought[9]==0){P1PerkBought[9]=1; P1PerkBoughtName[9]="JN";}
   acs_execute(410,0,0,0,0);
  }
  else if(ActivatorTID()==1338 && P2JN==0 && checkactorinventory(1338,"money") >= 2500 && power==1)
  {
  takeactorinventory(1338,"money",2500);
  giveactorinventory(1338,"Juggernog",1);
  P2JN = 1;
   if(P2PerkBought[1]==0){P2PerkBought[1]=1; P2PerkBoughtName[1]="JN";}
   else if(P2PerkBought[2]==0){P2PerkBought[2]=1; P2PerkBoughtName[2]="JN";}
   else if(P2PerkBought[3]==0){P2PerkBought[3]=1; P2PerkBoughtName[3]="JN";}
   else if(P2PerkBought[4]==0){P2PerkBought[4]=1; P2PerkBoughtName[4]="JN";}
   else if(P2PerkBought[5]==0){P2PerkBought[5]=1; P2PerkBoughtName[5]="JN";}
   else if(P2PerkBought[6]==0){P2PerkBought[6]=1; P2PerkBoughtName[6]="JN";}
   else if(P2PerkBought[7]==0){P2PerkBought[7]=1; P2PerkBoughtName[7]="JN";}
   else if(P2PerkBought[8]==0){P2PerkBought[8]=1; P2PerkBoughtName[8]="JN";}
   else if(P2PerkBought[9]==0){P2PerkBought[9]=1; P2PerkBoughtName[9]="JN";}
   acs_execute(413,0,0,0,0);
  }
}
//Quick Revive!////////////////////////////////////////////////////////////
Script 206 (void)
{
if(P1QR==0 && activatorTID()==1337 && p1QRbuy < 3 && power==1)
{
HudMessage(s:"Press \cfUSE \c-to Buy Quick Revive \cf[Cost:1500]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
}
else if(P2QR==0 && activatorTID()==1338 && p2QRbuy < 3 && power==1)
{
HudMessage(s:"Press \cfUSE \c-to Buy Quick Revive \cf[Cost:1500]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
}
else if(p2QRbuy==3 || p1QRbuy==3)
{
HudMessage(s:"Sorry! You bought this 3 times no more for you!";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
}
else if(power==0)
{
HudMessage(s:"Turn on the power!";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
}
}

script 207 (void)
{
  if(ActivatorTID()==1337 && P1QR==0 && checkactorinventory(1337,"money") >= 1500 && power==1)
  {
  takeactorinventory(1337,"money",1500);
  P1QR = 1;
   if(P1PerkBought[1]==0){P1PerkBought[1]=1; P1PerkBoughtName[1]="QR";}
   else if(P1PerkBought[2]==0){P1PerkBought[2]=1; P1PerkBoughtName[2]="QR";}
   else if(P1PerkBought[3]==0){P1PerkBought[3]=1; P1PerkBoughtName[3]="QR";}
   else if(P1PerkBought[4]==0){P1PerkBought[4]=1; P1PerkBoughtName[4]="QR";}
   else if(P1PerkBought[5]==0){P1PerkBought[5]=1; P1PerkBoughtName[5]="QR";}
   else if(P1PerkBought[6]==0){P1PerkBought[6]=1; P1PerkBoughtName[6]="QR";}
   else if(P1PerkBought[7]==0){P1PerkBought[7]=1; P1PerkBoughtName[7]="QR";}
   else if(P1PerkBought[8]==0){P1PerkBought[8]=1; P1PerkBoughtName[8]="QR";}
   else if(P1PerkBought[9]==0){P1PerkBought[9]=1; P1PerkBoughtName[9]="QR";}
   acs_execute(410,0,0,0,0);
  p1QRbuy = p1QRbuy + 1;
  acs_execute(208,0,0,0,0);
  giveactorinventory(1337,"QuickRevive",1);
  }
  else if(ActivatorTID()==1338 && P2QR==0 && checkactorinventory(1338,"money") >= 1500 && power==1)
  {
  takeactorinventory(1338,"money",1500);
  P2QR = 1;
   if(P2PerkBought[1]==0){P2PerkBought[1]=1; P2PerkBoughtName[1]="QR";}
   else if(P2PerkBought[2]==0){P2PerkBought[2]=1; P2PerkBoughtName[2]="QR";}
   else if(P2PerkBought[3]==0){P2PerkBought[3]=1; P2PerkBoughtName[3]="QR";}
   else if(P2PerkBought[4]==0){P2PerkBought[4]=1; P2PerkBoughtName[4]="QR";}
   else if(P2PerkBought[5]==0){P2PerkBought[5]=1; P2PerkBoughtName[5]="QR";}
   else if(P2PerkBought[6]==0){P2PerkBought[6]=1; P2PerkBoughtName[6]="QR";}
   else if(P2PerkBought[7]==0){P2PerkBought[7]=1; P2PerkBoughtName[7]="QR";}
   else if(P2PerkBought[8]==0){P2PerkBought[8]=1; P2PerkBoughtName[8]="QR";}
   else if(P2PerkBought[9]==0){P2PerkBought[9]=1; P2PerkBoughtName[9]="QR";}
   acs_execute(413,0,0,0,0);
  p2QRbuy = p2QRbuy + 1;
  acs_execute(209,0,0,0,0);
  giveactorinventory(1338,"QuickRevive",1);
  }
}

script 208 (void)
{
  while(P1QR==1)
  {
   if(GetActorProperty(1337, APROP_Health)<=25)
   {
        //Stop perks
		If(P1SS==0)
		{
        P1DT = 0;
        P1SC = 0;
        P1QR = 0;
        P1JN = 0;
        P1SU = 0;
        P1DS = 0;
        P1PHD = 0;  
        P1SS = 0;  
        P1MK = 0; 
		P1PerkBought[1]=0; P1PerkBoughtName[1]="";
        P1PerkBought[2]=0; P1PerkBoughtName[2]="";
        P1PerkBought[3]=0; P1PerkBoughtName[3]="";
        P1PerkBought[4]=0; P1PerkBoughtName[4]="";
        P1PerkBought[5]=0; P1PerkBoughtName[5]="";
        P1PerkBought[6]=0; P1PerkBoughtName[6]="";
        P1PerkBought[7]=0; P1PerkBoughtName[7]="";
        P1PerkBought[8]=0; P1PerkBoughtName[8]="";
        P1PerkBought[9]=0; P1PerkBoughtName[9]="";
        takeactorinventory(1337,"speedcola",1);
        takeactorinventory(1337,"Doubletap",1);
        takeactorinventory(1337,"staminaup",1);
        takeactorinventory(1337,"Juggernog",1);
        takeactorinventory(1337,"QuickRevive",1);
        takeactorinventory(1337,"deadshot",1);
        takeactorinventory(1337,"PhDflopper",1);
        takeactorinventory(1337,"mulekick",1);
        takeactorinventory(1337,"PHD",1);
        setactorproperty(1337,APROP_speed,1.1);
        HudMessage(s:"You have Been Revived! Perks Gone Tho!";
        HUDMSG_FADEOUT, 88, CR_ORANGE, 1.50, 0.1, 2.0, 2.5);
        setActorProperty(1337, APROP_Health,100);
		}
		else If(P1SS==1)
		{
        P1SS = 0;  
		 if(P1PerkBoughtName[1]=="SS"){P1PerkBought[1]=0; P1PerkBoughtName[1]="";}
		 else if(P1PerkBoughtName[2]=="SS"){P1PerkBought[2]=0; P1PerkBoughtName[2]="";}
		 else if(P1PerkBoughtName[3]=="SS"){P1PerkBought[3]=0; P1PerkBoughtName[3]="";}
		 else if(P1PerkBoughtName[4]=="SS"){P1PerkBought[4]=0; P1PerkBoughtName[4]="";}
		 else if(P1PerkBoughtName[5]=="SS"){P1PerkBought[5]=0; P1PerkBoughtName[5]="";}
		 else if(P1PerkBoughtName[6]=="SS"){P1PerkBought[6]=0; P1PerkBoughtName[6]="";}
		 else if(P1PerkBoughtName[7]=="SS"){P1PerkBought[7]=0; P1PerkBoughtName[7]="";}
		 else if(P1PerkBoughtName[8]=="SS"){P1PerkBought[8]=0; P1PerkBoughtName[8]="";}
		 else if(P1PerkBoughtName[9]=="SS"){P1PerkBought[9]=0; P1PerkBoughtName[9]="";}
        HudMessage(s:"You have Been Revived! Savior Soda  Has Been Removed!";
        HUDMSG_FADEOUT, 88, CR_ORANGE, 1.50, 0.1, 2.0, 2.5);
        setActorProperty(1337, APROP_Health,100);
		}
   }
   delay(1);
 }
}

script 209 (void)
{
  while(P2QR==1)
  {
   if(GetActorProperty(1338, APROP_Health)<=25)
   {
        //Stop perks
		If(P2SS==0)
		{
        P2DT = 0;
        P2SC = 0;
        P2QR = 0;
        P2JN = 0;
        P2SU = 0;
        P2DS = 0;
        P2PHD =0;
        P2SS = 0; 
        P2MK = 0; 
		P2PerkBought[1]=0; P2PerkBoughtName[1]="";
        P2PerkBought[2]=0; P2PerkBoughtName[2]="";
        P2PerkBought[3]=0; P2PerkBoughtName[3]="";
        P2PerkBought[4]=0; P2PerkBoughtName[4]="";
        P2PerkBought[5]=0; P2PerkBoughtName[5]="";
        P2PerkBought[6]=0; P2PerkBoughtName[6]="";
        P2PerkBought[7]=0; P2PerkBoughtName[7]="";
        P2PerkBought[8]=0; P2PerkBoughtName[8]="";
        P2PerkBought[9]=0; P2PerkBoughtName[9]="";
        takeactorinventory(1338,"speedcola",1);
        takeactorinventory(1338,"Doubletap",1);
        takeactorinventory(1338,"staminaup",1);
        takeactorinventory(1338,"Juggernog",1);
        takeactorinventory(1338,"QuickRevive",1);
        takeactorinventory(1338,"deadshot",1);
        takeactorinventory(1338,"PhDflopper",1);
        takeactorinventory(1338,"mulekick",1);
        takeactorinventory(1338,"PHD",1);
        HudMessage(s:"You have Been Revived! Perks Gone Tho!";
        HUDMSG_FADEOUT, 88, CR_ORANGE, 1.50, 0.1, 2.0, 2.5);
        setactorproperty(1338,APROP_speed,1.1);
        setActorProperty(1338, APROP_Health,100);
		}//Stop perks
		else If(P2SS==1)
		{
        P2SS = 0;  
		 if(P2PerkBoughtName[1]=="SS"){P2PerkBought[1]=0; P2PerkBoughtName[1]="";}
		 else if(P2PerkBoughtName[2]=="SS"){P2PerkBought[2]=0; P2PerkBoughtName[2]="";}
		 else if(P2PerkBoughtName[3]=="SS"){P2PerkBought[3]=0; P2PerkBoughtName[3]="";}
		 else if(P2PerkBoughtName[4]=="SS"){P2PerkBought[4]=0; P2PerkBoughtName[4]="";}
		 else if(P2PerkBoughtName[5]=="SS"){P2PerkBought[5]=0; P2PerkBoughtName[5]="";}
		 else if(P2PerkBoughtName[6]=="SS"){P2PerkBought[6]=0; P2PerkBoughtName[6]="";}
		 else if(P2PerkBoughtName[7]=="SS"){P2PerkBought[7]=0; P2PerkBoughtName[7]="";}
		 else if(P2PerkBoughtName[8]=="SS"){P2PerkBought[8]=0; P2PerkBoughtName[8]="";}
		 else if(P2PerkBoughtName[9]=="SS"){P2PerkBought[9]=0; P2PerkBoughtName[9]="";}
        HudMessage(s:"You have Been Revived! Savior Soda  Has Been Removed!";
        HUDMSG_FADEOUT, 88, CR_ORANGE, 1.50, 0.1, 2.0, 2.5);
        setActorProperty(1338, APROP_Health,100);
		}
	
   }
   delay(1);
 }
}
//Stamin-Up////////////////////////////////////
Script 214 (void)
{
  if(P1SU==0 && activatorTID()==1337 && power==1)
  {
  HudMessage(s:"Press \cfUSE \c-to Buy Stamin-Up \cf[Cost:1750]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
  else if(P2SU==0 && activatorTID()==1338 && power==1)
  {
  HudMessage(s:"Press \cfUSE \c-to Buy Stamin-Up \cf[Cost:1750]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
  else if(power==0)
  {
  HudMessage(s:"Turn on the power!";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
}

Script 215 (void)
{
  if(activatorTID()==1337 && P1SU==0 && checkactorinventory(1337,"money") >= 1750 && power==1)
  {
    setactorproperty(1337,aprop_speed,1.5);
    takeactorinventory(1337,"money",1750);
  giveactorinventory(1337,"staminaup",1);
    P1SU=1;
   if(P1PerkBought[1]==0){P1PerkBought[1]=1; P1PerkBoughtName[1]="SU";}
   else if(P1PerkBought[2]==0){P1PerkBought[2]=1; P1PerkBoughtName[2]="SU";}
   else if(P1PerkBought[3]==0){P1PerkBought[3]=1; P1PerkBoughtName[3]="SU";}
   else if(P1PerkBought[4]==0){P1PerkBought[4]=1; P1PerkBoughtName[4]="SU";}
   else if(P1PerkBought[5]==0){P1PerkBought[5]=1; P1PerkBoughtName[5]="SU";}
   else if(P1PerkBought[6]==0){P1PerkBought[6]=1; P1PerkBoughtName[6]="SU";}
   else if(P1PerkBought[7]==0){P1PerkBought[7]=1; P1PerkBoughtName[7]="SU";}
   else if(P1PerkBought[8]==0){P1PerkBought[8]=1; P1PerkBoughtName[8]="SU";}
   else if(P1PerkBought[9]==0){P1PerkBought[9]=1; P1PerkBoughtName[9]="SU";}
   acs_execute(410,0,0,0,0);
  }
  if(activatorTID()==1338 && P2SU==0 && checkactorinventory(1338,"money") >= 1750 && power==1)
  {
    setactorproperty(1338,aprop_speed,1.5);
    takeactorinventory(1338,"money",1750);
  giveactorinventory(1338,"staminaup",1);
    P2SU=1;
   if(P2PerkBought[1]==0){P2PerkBought[1]=1; P2PerkBoughtName[1]="SU";}
   else if(P2PerkBought[2]==0){P2PerkBought[2]=1; P2PerkBoughtName[2]="SU";}
   else if(P2PerkBought[3]==0){P2PerkBought[3]=1; P2PerkBoughtName[3]="SU";}
   else if(P2PerkBought[4]==0){P2PerkBought[4]=1; P2PerkBoughtName[4]="SU";}
   else if(P2PerkBought[5]==0){P2PerkBought[5]=1; P2PerkBoughtName[5]="SU";}
   else if(P2PerkBought[6]==0){P2PerkBought[6]=1; P2PerkBoughtName[6]="SU";}
   else if(P2PerkBought[7]==0){P2PerkBought[7]=1; P2PerkBoughtName[7]="SU";}
   else if(P2PerkBought[8]==0){P2PerkBought[8]=1; P2PerkBoughtName[8]="SU";}
   else if(P2PerkBought[9]==0){P2PerkBought[9]=1; P2PerkBoughtName[9]="SU";}
   acs_execute(413,0,0,0,0);
  }
}

//Deadshot////////////////////////////////////
Script 216 (void)
{
  if(P1DS==0 && activatorTID()==1337 && power==1)
  {
  HudMessage(s:"Press \cfUSE \c-to Buy Deadshot daiquiri \cf[Cost:1000]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
  else if(P2DS==0 && activatorTID()==1338 && power==1)
  {
  HudMessage(s:"Press \cfUSE \c-to Buy Deadshot \cf[Cost:1000]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
  else if(power==0)
  {
  HudMessage(s:"Turn on the power!";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
}

Script 217 (void)
{
  if(activatorTID()==1337 && P1DS==0 && checkactorinventory(1337,"money") >= 1000 && power==1)
  {
    takeactorinventory(1337,"money",1000);
  giveactorinventory(1337,"Deadshot",1);
    P1DS=1;
   if(P1PerkBought[1]==0){P1PerkBought[1]=1; P1PerkBoughtName[1]="DS";}
   else if(P1PerkBought[2]==0){P1PerkBought[2]=1; P1PerkBoughtName[2]="DS";}
   else if(P1PerkBought[3]==0){P1PerkBought[3]=1; P1PerkBoughtName[3]="DS";}
   else if(P1PerkBought[4]==0){P1PerkBought[4]=1; P1PerkBoughtName[4]="DS";}
   else if(P1PerkBought[5]==0){P1PerkBought[5]=1; P1PerkBoughtName[5]="DS";}
   else if(P1PerkBought[6]==0){P1PerkBought[6]=1; P1PerkBoughtName[6]="DS";}
   else if(P1PerkBought[7]==0){P1PerkBought[7]=1; P1PerkBoughtName[7]="DS";}
   else if(P1PerkBought[8]==0){P1PerkBought[8]=1; P1PerkBoughtName[8]="DS";}
   else if(P1PerkBought[9]==0){P1PerkBought[9]=1; P1PerkBoughtName[9]="DS";}
   acs_execute(410,0,0,0,0);
  }
  if(activatorTID()==1338 && P2DS==0 && checkactorinventory(1338,"money") >= 1000 && power==1)
  {
    takeactorinventory(1338,"money",1000);
  giveactorinventory(1338,"Deadshot",1);
    P2DS=1;
   if(P2PerkBought[1]==0){P2PerkBought[1]=1; P2PerkBoughtName[1]="DS";}
   else if(P2PerkBought[2]==0){P2PerkBought[2]=1; P2PerkBoughtName[2]="DS";}
   else if(P2PerkBought[3]==0){P2PerkBought[3]=1; P2PerkBoughtName[3]="DS";}
   else if(P2PerkBought[4]==0){P2PerkBought[4]=1; P2PerkBoughtName[4]="DS";}
   else if(P2PerkBought[5]==0){P2PerkBought[5]=1; P2PerkBoughtName[5]="DS";}
   else if(P2PerkBought[6]==0){P2PerkBought[6]=1; P2PerkBoughtName[6]="DS";}
   else if(P2PerkBought[7]==0){P2PerkBought[7]=1; P2PerkBoughtName[7]="DS";}
   else if(P2PerkBought[8]==0){P2PerkBought[8]=1; P2PerkBoughtName[8]="DS";}
   else if(P2PerkBought[9]==0){P2PerkBought[9]=1; P2PerkBoughtName[9]="DS";}
   acs_execute(413,0,0,0,0);
  }
}


//PHD Flopper////////////////////////////////////
Script 218 (void)
{
  if(P1PHD==0 && activatorTID()==1337 && power==1)
  {
  HudMessage(s:"Press \cfUSE \c-to Buy PHD Flopper \cf[Cost:2000]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
  else if(P2PHD==0 && activatorTID()==1338 && power==1)
  {
  HudMessage(s:"Press \cfUSE \c-to Buy PHD Flopper \cf[Cost:2000]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
  else if(power==0)
  {
  HudMessage(s:"Turn on the power!";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
}

Script 219 (void)
{
  if(activatorTID()==1337 && P1PHD==0 && checkactorinventory(1337,"money") >= 2000 && power==1)
  {
    takeactorinventory(1337,"money",2000);
    giveactorinventory(1337,"PhDflopper",1);
    giveactorinventory(1337,"PHD",1);
    P1PHD=1;
   if(P1PerkBought[1]==0){P1PerkBought[1]=1; P1PerkBoughtName[1]="PH";}
   else if(P1PerkBought[2]==0){P1PerkBought[2]=1; P1PerkBoughtName[2]="PH";}
   else if(P1PerkBought[3]==0){P1PerkBought[3]=1; P1PerkBoughtName[3]="PH";}
   else if(P1PerkBought[4]==0){P1PerkBought[4]=1; P1PerkBoughtName[4]="PH";}
   else if(P1PerkBought[5]==0){P1PerkBought[5]=1; P1PerkBoughtName[5]="PH";}
   else if(P1PerkBought[6]==0){P1PerkBought[6]=1; P1PerkBoughtName[6]="PH";}
   else if(P1PerkBought[7]==0){P1PerkBought[7]=1; P1PerkBoughtName[7]="PH";}
   else if(P1PerkBought[8]==0){P1PerkBought[8]=1; P1PerkBoughtName[8]="PH";}
   else if(P1PerkBought[9]==0){P1PerkBought[9]=1; P1PerkBoughtName[9]="PH";}
   acs_execute(410,0,0,0,0);
  }
  if(activatorTID()==1338 && P1PHD==0 && checkactorinventory(1338,"money") >= 2000 && power==1)
  {
    takeactorinventory(1338,"money",2000);
    giveactorinventory(1338,"PhDflopper",1);
    giveactorinventory(1338,"PHD",1);
    P2PHD=1;
   if(P2PerkBought[1]==0){P2PerkBought[1]=1; P2PerkBoughtName[1]="PH";}
   else if(P2PerkBought[2]==0){P2PerkBought[2]=1; P2PerkBoughtName[2]="PH";}
   else if(P2PerkBought[3]==0){P2PerkBought[3]=1; P2PerkBoughtName[3]="PH";}
   else if(P2PerkBought[4]==0){P2PerkBought[4]=1; P2PerkBoughtName[4]="PH";}
   else if(P2PerkBought[5]==0){P2PerkBought[5]=1; P2PerkBoughtName[5]="PH";}
   else if(P2PerkBought[6]==0){P2PerkBought[6]=1; P2PerkBoughtName[6]="PH";}
   else if(P2PerkBought[7]==0){P2PerkBought[7]=1; P2PerkBoughtName[7]="PH";}
   else if(P2PerkBought[8]==0){P2PerkBought[8]=1; P2PerkBoughtName[8]="PH";}
   else if(P2PerkBought[9]==0){P2PerkBought[9]=1; P2PerkBoughtName[9]="PH";}
   acs_execute(413,0,0,0,0);
  }
}

//Savior Soda////////////////////////////////////
Script 220 (void)
{
  if(P1SS==0 && activatorTID()==1337 && power==1)
  {
  HudMessage(s:"Press \cfUSE \c-to Buy Savior Soda \cf[Cost:4000]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
  else if(P2SS==0 && activatorTID()==1338 && power==1)
  {
  HudMessage(s:"Press \cfUSE \c-to Buy Savior Soda \cf[Cost:4000]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
  else if(power==0)
  {
  HudMessage(s:"Turn on the power!";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
}

Script 221 (void)
{
  if(activatorTID()==1337 && P1SS==0 && checkactorinventory(1337,"money") >= 4000 && power==1)
  {
    takeactorinventory(1337,"money",4000);
    P1SS=1;
   if(P1PerkBought[1]==0){P1PerkBought[1]=1; P1PerkBoughtName[1]="SS";}
   else if(P1PerkBought[2]==0){P1PerkBought[2]=1; P1PerkBoughtName[2]="SS";}
   else if(P1PerkBought[3]==0){P1PerkBought[3]=1; P1PerkBoughtName[3]="SS";}
   else if(P1PerkBought[4]==0){P1PerkBought[4]=1; P1PerkBoughtName[4]="SS";}
   else if(P1PerkBought[5]==0){P1PerkBought[5]=1; P1PerkBoughtName[5]="SS";}
   else if(P1PerkBought[6]==0){P1PerkBought[6]=1; P1PerkBoughtName[6]="SS";}
   else if(P1PerkBought[7]==0){P1PerkBought[7]=1; P1PerkBoughtName[7]="SS";}
   else if(P1PerkBought[8]==0){P1PerkBought[8]=1; P1PerkBoughtName[8]="SS";}
   else if(P1PerkBought[9]==0){P1PerkBought[9]=1; P1PerkBoughtName[9]="SS";}
   acs_execute(410,0,0,0,0);
  }
  if(activatorTID()==1338 && P2SS==0 && checkactorinventory(1338,"money") >= 4000 && power==1)
  {
    takeactorinventory(1338,"money",4000);
    P2SS=1;
   if(P2PerkBought[1]==0){P2PerkBought[1]=1; P2PerkBoughtName[1]="SS";}
   else if(P2PerkBought[2]==0){P2PerkBought[2]=1; P2PerkBoughtName[2]="SS";}
   else if(P2PerkBought[3]==0){P2PerkBought[3]=1; P2PerkBoughtName[3]="SS";}
   else if(P2PerkBought[4]==0){P2PerkBought[4]=1; P2PerkBoughtName[4]="SS";}
   else if(P2PerkBought[5]==0){P2PerkBought[5]=1; P2PerkBoughtName[5]="SS";}
   else if(P2PerkBought[6]==0){P2PerkBought[6]=1; P2PerkBoughtName[6]="SS";}
   else if(P2PerkBought[7]==0){P2PerkBought[7]=1; P2PerkBoughtName[7]="SS";}
   else if(P2PerkBought[8]==0){P2PerkBought[8]=1; P2PerkBoughtName[8]="SS";}
   else if(P2PerkBought[9]==0){P2PerkBought[9]=1; P2PerkBoughtName[9]="SS";}
   acs_execute(413,0,0,0,0);
  }
}
//Mule Kick////////////////////////////////////
Script 222 (void)
{
  if(P1MK==0 && activatorTID()==1337 && power==1)
  {
  HudMessage(s:"Press \cfUSE \c-to Buy Mule Kick \cf[Cost:4000]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
  else if(P2MK==0 && activatorTID()==1338 && power==1)
  {
  HudMessage(s:"Press \cfUSE \c-to Buy Mule Kick \cf[Cost:4000]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
  else if(power==0)
  {
  HudMessage(s:"Turn on the power!";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
}

Script 223 (void)
{
  if(activatorTID()==1337 && P1MK==0 && checkactorinventory(1337,"money") >= 4000 && power==1)
  {
    giveactorinventory(1337,"mulekick",1);
    takeactorinventory(1337,"money",4000);
    P1MK=1;
   if(P1PerkBought[1]==0){P1PerkBought[1]=1; P1PerkBoughtName[1]="MK";}
   else if(P1PerkBought[2]==0){P1PerkBought[2]=1; P1PerkBoughtName[2]="MK";}
   else if(P1PerkBought[3]==0){P1PerkBought[3]=1; P1PerkBoughtName[3]="MK";}
   else if(P1PerkBought[4]==0){P1PerkBought[4]=1; P1PerkBoughtName[4]="MK";}
   else if(P1PerkBought[5]==0){P1PerkBought[5]=1; P1PerkBoughtName[5]="MK";}
   else if(P1PerkBought[6]==0){P1PerkBought[6]=1; P1PerkBoughtName[6]="MK";}
   else if(P1PerkBought[7]==0){P1PerkBought[7]=1; P1PerkBoughtName[7]="MK";}
   else if(P1PerkBought[8]==0){P1PerkBought[8]=1; P1PerkBoughtName[8]="MK";}
   else if(P1PerkBought[9]==0){P1PerkBought[9]=1; P1PerkBoughtName[9]="MK";}
   acs_execute(410,0,0,0,0);
  }
  if(activatorTID()==1338 && P2MK==0 && checkactorinventory(1338,"money") >= 4000 && power==1)
  {
    giveactorinventory(1338,"mulekick",1);
    takeactorinventory(1338,"money",4000);
    P2MK=1;
   if(P2PerkBought[1]==0){P2PerkBought[1]=1; P2PerkBoughtName[1]="MK";}
   else if(P2PerkBought[2]==0){P2PerkBought[2]=1; P2PerkBoughtName[2]="MK";}
   else if(P2PerkBought[3]==0){P2PerkBought[3]=1; P2PerkBoughtName[3]="MK";}
   else if(P2PerkBought[4]==0){P2PerkBought[4]=1; P2PerkBoughtName[4]="MK";}
   else if(P2PerkBought[5]==0){P2PerkBought[5]=1; P2PerkBoughtName[5]="MK";}
   else if(P2PerkBought[6]==0){P2PerkBought[6]=1; P2PerkBoughtName[6]="MK";}
   else if(P2PerkBought[7]==0){P2PerkBought[7]=1; P2PerkBoughtName[7]="MK";}
   else if(P2PerkBought[8]==0){P2PerkBought[8]=1; P2PerkBoughtName[8]="MK";}
   else if(P2PerkBought[9]==0){P2PerkBought[9]=1; P2PerkBoughtName[9]="ML";}
   acs_execute(413,0,0,0,0);
  }
}

script 752 (int whattodo2)
{
  if(whattodo2==1 && gameskill()!=4)
  {setactorproperty(667,APROP_Health,600000+wavenumber*15000);acs_executeAlways(424,0,0,0,0);}
  else if(whattodo2==1 && Gameskill()==4 && Timeon==1)
  {setactorproperty(667,APROP_Health,600000+minutes*15000);acs_executeAlways(424,0,0,0,0);}
}

script 750 (int whattodo)
{
  if(whattodo==1 && gameskill()!=4)
  {setactorproperty(666,APROP_Health,500+wavenumber*3900);acs_executeAlways(8,0,0,0,0);}
  else if(whattodo==1 && Gameskill()==4 && Timeon==1)
  {setactorproperty(666,APROP_Health,500+wavenumber*3900);acs_executeAlways(8,0,0,0,0);}
}

script 424 (void)
{
    int hatedPlayer2;
    if(playercount()==1 && GetActorProperty(1337, APROP_Health) >= 0)
    {
        hatedPlayer2 = 1337;
    }
    else if(playercount()>1 && GetActorProperty(1337, APROP_Health) >= 0  && GetActorProperty(1338, APROP_Health) >= 0)
    {
        hatedPlayer2 = random(1337,1338);
    }
    else if(playercount()>1 && GetActorProperty(1337, APROP_Health) >= 0  && GetActorProperty(1338, APROP_Health) <= 0)
    {
        hatedPlayer2 = 1337;
    }
    else if(playercount()>1 && GetActorProperty(1337, APROP_Health) <= 0  && GetActorProperty(1338, APROP_Health) >= 0)
    {
        hatedPlayer2 = 1338;
    }
    
    Thing_Hate(667,hatedplayer2,0);
}

script 8 (void)
{
    int hatedPlayer;
    if(playercount()==1 && GetActorProperty(1337, APROP_Health) >= 0)
    {
        hatedPlayer = 1337;
    }
    else if(playercount()>1 && GetActorProperty(1337, APROP_Health) >= 0  && GetActorProperty(1338, APROP_Health) >= 0)
    {
        hatedPlayer = random(1337,1338);
    }
    else if(playercount()>1 && GetActorProperty(1337, APROP_Health) >= 0  && GetActorProperty(1338, APROP_Health) <= 0)
    {
        hatedPlayer = 1337;
    }
    else if(playercount()>1 && GetActorProperty(1337, APROP_Health) <= 0  && GetActorProperty(1338, APROP_Health) >= 0)
    {
        hatedPlayer = 1338;
    }
    
    Thing_Hate(666,hatedplayer,0);
}

script 66 (int gunid)
{
//MP40///////////////////////////////////////////////////////////////////////
if(gunid==1)
{HudMessage(s:"Press \cfUSE \c-to buy the MP40 \cf[cost:1000] \c-ammo \cf[cost:500] \c-upgraded ammo \cf[cost:4500]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);}
//Chaingun////////////////////////////////////////////////////////////////////////
else if(gunid==2)
{HudMessage(s:"Press \cfUSE \c-to buy the Chaingun \cf[cost:1000] \c-ammo \cf[cost:500] \c-upgraded ammo \cf[cost:4500]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);}
//Shotgun////////////////////////////////////////////////////////////////////////
else if(gunid==3)
{HudMessage(s:"Press \cfUSE \c-to buy the Shotgun \cf[cost:500] \c-ammo \cf[cost:250]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);}
//SuperShotgun////////////////////////////////////////////////////////////////////////
else if(gunid==4)
{HudMessage(s:"Press \cfUSE \c-to buy the Super Shotgun \cf[cost:1500] \c-ammo \cf[cost:750]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);}
//grenades////////////////////////////////////////////////////////////////////////
else if(gunid==5)
{HudMessage(s:"Press \cfUSE \c-to buy Grenades \cf[cost:500]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);}
//MP5////////////////////////////////////////////////////////////////////////
else if(gunid==6)
{HudMessage(s:"Press \cfUSE \c-to buy the MP5 \cf[cost:1000] \c-ammo \cf[cost:500] \c-upgraded ammo \cf[cost:4500]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);}
//M16////////////////////////////////////////////////////////////////////////
else if(gunid==7)
{HudMessage(s:"Press \cfUSE \c-to buy the M16 \cf[cost:1200] \c-ammo \cf[cost:600] \c-upgraded ammo \cf[cost:4500]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);}
//Claymores////////////////////////////////////////////////////////////////////////
else if(gunid==8)
{HudMessage(s:"Press \cfUSE \c-to buy Claymores \cf[cost:1000] \c-a one time buy if you did not die!\n\ 2 per round given";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);}
//M1////////////////////////////////////////////////////////////////////////
else if(gunid==9)
{HudMessage(s:"Press \cfUSE \c-to buy the M1 [cost:500] \c-ammo \cf[cost:250] \c-upgraded ammo \cf[cost:4500]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);}
else if(gunid==10)
{    
  if(ActivatorTID()==1337 && checkactorinventory(1337,"Machete")==0)
    {
    HudMessage(s:"Press \cfUSE \c-to buy the Machete \cf[cost:3000]";
                HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
    }
    else if(ActivatorTID()==1338 && checkactorinventory(1338,"Machete")==0)
    {
    HudMessage(s:"Press \cfUSE \c-to buy the Machete \cf[cost:3000]";
                HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
     }
  }
//Thomson////////////////////////////////////////////////////////////////////////
else if(gunid==11)
{HudMessage(s:"Press \cfUSE \c-to buy the Thomson \cf[cost:1200] \c-ammo \cf[cost:600] \c-upgraded ammo \cf[cost:4500]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);}
//Megasphere////////////////////////////////////////////////////////////////////////
else if(gunid==12)
{HudMessage(s:"Press \cfUSE \c-to buy a megashpere (ohhh thats new!) \cf[cost:2250]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);}
//Duke Shotgun////////////////////////////////////////////////////////////////////////
else if(gunid==13)
{HudMessage(s:"Press \cfUSE \c-to buy a Duke Shotgun \cf[cost:1500] \c-ammo \cf[cost:750] \c-upgraded ammo \cf[cost:4500]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);}
}

script 67 (int gun2id)
{    
   If(activatorTID()==1337)
   {
     if(gun2id==1)
     {
                if(checkinventory("PAPMP40") && CheckactorInventory(1337,"money") >= 4500)
                {
                        GiveInventory("PAPMP40ammo", 999);
                        GiveInventory("PAPMP40clip", 99);
                        takeActorInventory(1337,"money",4500);
                }
                else if(CheckInventory("MP40") && CheckactorInventory(1337,"money") >= 500)
                {
                        GiveInventory("MP40ammo", 999);
                        GiveInventory("MP40clip", 99);
                        takeActorInventory(1337,"money",500);
                }
                else if(!CheckInventory("MP40") && !CheckInventory("PAPMP40") && CheckactorInventory(1337,"money") >= 1000 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("MP40ammo", 999);
                    GiveInventory("MP40clip", 99);
                    GiveInventory("MP40",1);
                    GiveInventory("MuleKickMaxWeapons",1);
                    takeActorInventory(1337,"money",1000);
                    SetWeapon("MP40");
                }
                else if(!CheckInventory("MP40") && !CheckInventory("PAPMP40") && CheckactorInventory(1337,"money") >= 1000 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") >=1 && checkactorinventory(1337,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("MP40ammo", 999);
                    GiveInventory("MP40clip", 99);
                    GiveInventory("MP40",1);
                    GiveInventory("MuleKickMaxWeapons",1);
                    takeActorInventory(1337,"money",1000);
                    SetWeapon("MP40");
                }
                else if(!CheckInventory("MP40") && !CheckInventory("PAPMP40") && CheckactorInventory(1337,"money") >= 1000 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("MP40ammo", 999);
                    GiveInventory("MP40clip", 99);
                    GiveInventory("MP40",1);
                    takeActorInventory(1337,"money",1000);
                    SetWeapon("MP40");
                }
                else if(!CheckInventory("MP40") && !CheckInventory("PAPMP40") && CheckactorInventory(1337,"money") >= 1000 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("MP40ammo", 999);
                    GiveInventory("MP40clip", 99);
                    GiveInventory("MP40",1);
                    takeActorInventory(1337,"money",1000);
                    SetWeapon("MP40");
                }

     }
     else if(gun2id==2)
     {
                 if(checkinventory("PAPChaingun") && CheckactorInventory(1337,"money") >= 4500)
                {
                        GiveInventory("PAPChaingunammo", 999);
                        GiveInventory("PAPChaingunclip", 99);
                        takeActorInventory(1337,"money",4500);
                }
                 else if(CheckInventory("normalChaingun") && CheckactorInventory(1337,"money") >= 500)
                {
                        GiveInventory("Chaingunammo", 999);
                        GiveInventory("Chaingunclip", 99);
                        takeActorInventory(1337,"money",500);
                }
                else if(!CheckInventory("normalChaingun") && !CheckInventory("PAPChaingun") && CheckactorInventory(1337,"money") >= 1000 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("Chaingunammo", 999);
                    GiveInventory("Chaingunclip", 99);
                    GiveInventory("normalChaingun",1);
                    GiveInventory("MuleKickMaxWeapons",1);
                    takeActorInventory(1337,"money",1000);
                    SetWeapon("normalChaingun");
                }
                else if(!CheckInventory("normalChaingun") && !CheckInventory("PAPChaingun") && CheckactorInventory(1337,"money") >= 1000 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") >=1 && checkactorinventory(1337,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("Chaingunammo", 999);
                    GiveInventory("Chaingunclip", 99);
                    GiveInventory("normalChaingun",1);
                    GiveInventory("MuleKickMaxWeapons",1);
                    takeActorInventory(1337,"money",1000);
                    SetWeapon("normalChaingun");
                }
                else if(!CheckInventory("normalChaingun") && !CheckInventory("PAPChaingun") && CheckactorInventory(1337,"money") >= 1000 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("Chaingunammo", 999);
                    GiveInventory("Chaingunclip", 99);
                    GiveInventory("normalChaingun",1);
                    takeActorInventory(1337,"money",1000);
                    SetWeapon("normalChaingun");
                }
                else if(!CheckInventory("normalChaingun") && !CheckInventory("PAPChaingun") && CheckactorInventory(1337,"money") >= 1000 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("Chaingunammo", 999);
                    GiveInventory("Chaingunclip", 99);
                    GiveInventory("normalChaingun",1);
                    takeActorInventory(1337,"money",1000);
                    SetWeapon("normalChaingun");
                }
     }
     else if(gun2id==3)
     {
           if(CheckInventory("normalshotgun") || checkinventory("PAPshotgun") && CheckactorInventory(1337,"money") >= 250)
                {
                        GiveInventory("shotgunammo", 999);
                        GiveInventory("shotgunclip", 99);
                        takeActorInventory(1337,"money",250);
                }
                else if(!CheckInventory("normalshotgun") && !CheckInventory("PAPshotgun") && CheckactorInventory(1337,"money") >= 500 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("shotgunammo", 999);
                    GiveInventory("shotgunclip", 99);
                    GiveInventory("normalshotgun",1);
                    takeActorInventory(1337,"money",500);
                    SetWeapon("normalshotgun");
                }     
                else if(!CheckInventory("normalshotgun") && !CheckInventory("PAPshotgun") && CheckactorInventory(1337,"money") >= 500 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") >=1 && checkactorinventory(1337,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("shotgunammo", 999);
                    GiveInventory("shotgunclip", 99);
                    GiveInventory("normalshotgun",1);
                    takeActorInventory(1337,"money",500);
                    SetWeapon("normalshotgun");
                }
                else if(!CheckInventory("normalshotgun") && !CheckInventory("PAPshotgun") && CheckactorInventory(1337,"money") >= 500 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("shotgunammo", 999);
                    GiveInventory("shotgunclip", 99);
                    GiveInventory("normalshotgun",1);
                    takeActorInventory(1337,"money",500);
                    SetWeapon("normalshotgun");
                }
                else if(!CheckInventory("normalshotgun") && !CheckInventory("PAPshotgun") && CheckactorInventory(1337,"money") >= 500 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("shotgunammo", 999);
                    GiveInventory("shotgunclip", 99);
                    GiveInventory("normalshotgun",1);
                    takeActorInventory(1337,"money",500);
                    SetWeapon("normalshotgun");
                }
     }
     else if(gun2id==4)
     {
           if(CheckInventory("SSG") || checkinventory("PAPSSG") && CheckactorInventory(1337,"money") >= 750)
                {
                        GiveInventory("SSGammo", 999);
                        GiveInventory("SSGclip", 99);
                        takeActorInventory(1337,"money",750);
                }
                else if(!CheckInventory("SSG") && !CheckInventory("PAPSSG") && CheckactorInventory(1337,"money") >= 1500 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("SSGammo", 999);
                    GiveInventory("SSGclip", 99);
                    GiveInventory("SSG",1);
                    takeActorInventory(1337,"money",1500);
                    SetWeapon("SSG");
                }   
                else if(!CheckInventory("SSG") && !CheckInventory("PAPSSG") && CheckactorInventory(1337,"money") >= 1500 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") >=1 && checkactorinventory(1337,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("SSGammo", 999);
                    GiveInventory("SSGclip", 99);
                    GiveInventory("SSG",1);
                    takeActorInventory(1337,"money",1500);
                    SetWeapon("SSG");
                }
                else if(!CheckInventory("SSG") && !CheckInventory("PAPSSG") && CheckactorInventory(1337,"money") >= 1500 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("SSGammo", 999);
                    GiveInventory("SSGclip", 99);
                    GiveInventory("SSG",1);
                    takeActorInventory(1337,"money",1500);
                    SetWeapon("SSG");
                }
                else if(!CheckInventory("SSG") && !CheckInventory("PAPSSG") && CheckactorInventory(1337,"money") >= 1500 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("SSGammo", 999);
                    GiveInventory("SSGclip", 99);
                    GiveInventory("SSG",1);
                    takeActorInventory(1337,"money",1500);
                    SetWeapon("SSG");
                }       
     }
     else if(gun2id==5)
     {
                if(CheckactorInventory(1337,"money") >= 500)
                {
                        GiveInventory("grenadeammo", 4);
                        takeActorInventory(1337,"money",500);
                }        
     }
     else if(gun2id==6)
     {
                if(checkinventory("PAPMP5") && CheckactorInventory(1337,"money") >= 4500)
                {
                        GiveInventory("PAPMP5ammo", 999);
                        GiveInventory("PAPMP5clip", 99);
                        takeActorInventory(1337,"money",4500);
                }
                else if(CheckInventory("MP5") && CheckactorInventory(1337,"money") >= 500)
                {
                        GiveInventory("MP5ammo", 999);
                        GiveInventory("MP5clip", 99);
                        takeActorInventory(1337,"money",500);
                }
                else if(!CheckInventory("MP5") && !CheckInventory("PAPMP5") && CheckactorInventory(1337,"money") >= 1000 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("MP5ammo", 999);
                    GiveInventory("MP5clip", 99);
                    GiveInventory("MP5",1);
                    takeActorInventory(1337,"money",1000);
                    SetWeapon("MP5");
                }    
                else if(!CheckInventory("MP5") && !CheckInventory("PAPMP5") && CheckactorInventory(1337,"money") >= 1000 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") >=1 && checkactorinventory(1337,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("MP5ammo", 999);
                    GiveInventory("MP5clip", 99);
                    GiveInventory("MP5",1);
                    takeActorInventory(1337,"money",1000);
                    SetWeapon("MP5");
                }
                else if(!CheckInventory("MP5") && !CheckInventory("PAPMP5") && CheckactorInventory(1337,"money") >= 1000 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("MP5ammo", 999);
                    GiveInventory("MP5clip", 99);
                    GiveInventory("MP5",1);
                    takeActorInventory(1337,"money",1000);
                    SetWeapon("MP5");
                }
                else if(!CheckInventory("MP5") && !CheckInventory("PAPMP5") && CheckactorInventory(1337,"money") >= 1000 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("MP5ammo", 999);
                    GiveInventory("MP5clip", 99);
                    GiveInventory("MP5",1);
                    takeActorInventory(1337,"money",1000);
                    SetWeapon("MP5");
                }    
     }
     else if(gun2id==7)
     {
                if(checkinventory("PAPM16") && CheckactorInventory(1337,"money") >= 4500)
                {
                        GiveInventory("PAPM16ammo", 999);
                        GiveInventory("PAPM16clip", 99);
                        takeActorInventory(1337,"money",4500);
                }
                else if(CheckInventory("M16") && CheckactorInventory(1337,"money") >= 600)
                {
                        GiveInventory("M16ammo", 999);
                        GiveInventory("M16clip", 99);
                        takeActorInventory(1337,"money",600);
                }
                else if(!CheckInventory("M16") && !CheckInventory("PAPM16") && CheckactorInventory(1337,"money") >= 1200 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("M16ammo", 999);
                    GiveInventory("M16clip", 99);
                    GiveInventory("M16",1);
                    takeActorInventory(1337,"money",1200);
                    SetWeapon("M16");
                }     
                else if(!CheckInventory("M16") && !CheckInventory("PAPM16") && CheckactorInventory(1337,"money") >= 1200 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") >=1 && checkactorinventory(1337,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("M16ammo", 999);
                    GiveInventory("M16clip", 99);
                    GiveInventory("M16",1);
                    takeActorInventory(1337,"money",1200);
                    SetWeapon("M16");
                }
                else if(!CheckInventory("M16") && !CheckInventory("PAPM16") && CheckactorInventory(1337,"money") >= 1200 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("M16ammo", 999);
                    GiveInventory("M16clip", 99);
                    GiveInventory("M16",1);
                    takeActorInventory(1337,"money",1200);
                    SetWeapon("M16");
                }
                else if(!CheckInventory("M16") && !CheckInventory("PAPM16") && CheckactorInventory(1337,"money") >= 1200 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("M16ammo", 999);
                    GiveInventory("M16clip", 99);
                    GiveInventory("M16",1);
                    takeActorInventory(1337,"money",1200);
                    SetWeapon("M16");
                }     
     }
     else if(gun2id==8)
     {
                if(CheckactorInventory(1337,"money") >= 1000 && P1claysBought==0)
                {
                        //GiveInventory("Claymoreammo", 2);
                        //giveactorinventory(1337,"ClaymoreMine",1);
                        //takeActorInventory(1337,"money",1000);
						              // P1claysBought=1;
                }      
     }
     else if(gun2id==9)
     {
                if(checkinventory("PAPM1") && CheckactorInventory(1337,"money") >= 4500)
                {
                        GiveInventory("PAPM1ammo", 999);
                        GiveInventory("PAPM1clip", 99);
                        takeActorInventory(1337,"money",4500);
                }
                else if(CheckInventory("M1") && CheckactorInventory(1337,"money") >= 250)
                {
                        GiveInventory("M1ammo", 999);
                        GiveInventory("M1clip", 99);
                        takeActorInventory(1337,"money",250);
                }
                else if(!CheckInventory("M1") && !CheckInventory("PAPM1") && CheckactorInventory(1337,"money") >= 500 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("M1ammo", 999);
                    GiveInventory("M1clip", 99);
                    GiveInventory("M1",1);
                    takeActorInventory(1337,"money",500);
                    SetWeapon("M1");
                }   
                else if(!CheckInventory("M1") && !CheckInventory("PAPM1") && CheckactorInventory(1337,"money") >= 500 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") >=1 && checkactorinventory(1337,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("M1ammo", 999);
                    GiveInventory("M1clip", 99);
                    GiveInventory("M1",1);
                    takeActorInventory(1337,"money",500);
                    SetWeapon("M1");
                }
                else if(!CheckInventory("M1") && !CheckInventory("PAPM1") && CheckactorInventory(1337,"money") >= 500 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("M1ammo", 999);
                    GiveInventory("M1clip", 99);
                    GiveInventory("M1",1);
                    takeActorInventory(1337,"money",500);
                    SetWeapon("M1");
                }
                else if(!CheckInventory("M1") && !CheckInventory("PAPM1") && CheckactorInventory(1337,"money") >= 500 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("M1ammo", 999);
                    GiveInventory("M1clip", 99);
                    GiveInventory("M1",1);
                    takeActorInventory(1337,"money",500);
                    SetWeapon("M1");
                }       
     }
     else if(gun2id==10)
     {
       //Player 1
            if(checkactorinventory(1337,"Machete")==0 && CheckactorInventory(1337,"money") >= 3000)
            {
                        giveactorinventory(1337,"Machete",1);
                        takeActorInventory(1337,"money",3000);
            }
     }
     else if(gun2id==11)
     {
                if(checkinventory("PAPThomson") && CheckactorInventory(1337,"money") >= 4500)
                {
                        GiveInventory("PAPThomsonammo", 999);
                        GiveInventory("PAPThomsonclip", 99);
                        takeActorInventory(1337,"money",4500);
                }
                else if(CheckInventory("Thomson") && CheckactorInventory(1337,"money") >= 600)
                {
                        GiveInventory("Thomsonammo", 999);
                        GiveInventory("Thomsonclip", 99);
                        takeActorInventory(1337,"money",600);
                }
                else if(!CheckInventory("Thomson") && !CheckInventory("PAPThomson") && CheckactorInventory(1337,"money") >= 1200 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("Thomsonammo", 999);
                    GiveInventory("Thomsonclip", 99);
                    GiveInventory("Thomson",1);
                    takeActorInventory(1337,"money",1200);
                    SetWeapon("Thomson");
                }   
                else if(!CheckInventory("Thomson") && !CheckInventory("PAPThomson") && CheckactorInventory(1337,"money") >= 1200 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") >=1 && checkactorinventory(1337,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("Thomsonammo", 999);
                    GiveInventory("Thomsonclip", 99);
                    GiveInventory("Thomson",1);
                    takeActorInventory(1337,"money",1200);
                    SetWeapon("Thomson");
                }
                else if(!CheckInventory("Thomson") && !CheckInventory("PAPThomson") && CheckactorInventory(1337,"money") >= 1200 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("Thomsonammo", 999);
                    GiveInventory("Thomsonclip", 99);
                    GiveInventory("Thomson",1);
                    takeActorInventory(1337,"money",1200);
                    SetWeapon("Thomson");
                }
                else if(!CheckInventory("Thomson") && !CheckInventory("PAPThomson") && CheckactorInventory(1337,"money") >= 1200 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("Thomsonammo", 999);
                    GiveInventory("Thomsonclip", 99);
                    GiveInventory("Thomson",1);
                    takeActorInventory(1337,"money",1200);
                    SetWeapon("Thomson");
                }          
     }
     else if(gun2id==12)
     {
       //Player 1
            if(CheckactorInventory(1337,"money") >= 2250)
            {
                        giveactorinventory(1337,"Megasphere",1);
                        takeActorInventory(1337,"money",2250);
            }
     }
     else if(gun2id==13)
     {
                if(checkinventory("PAPDukeshotgun") && CheckactorInventory(1337,"money") >= 4500)
                {
                        GiveInventory("PAPDukeammo", 999);
                        GiveInventory("PAPDukeclip", 99);
                        takeActorInventory(1337,"money",4500);
                }
                else if(CheckInventory("Dukeshotgun") && CheckactorInventory(1337,"money") >= 750)
                {
                        GiveInventory("Dukeammo", 999);
                        GiveInventory("Dukeclip", 99);
                        takeActorInventory(1337,"money",750);
                }
                else if(!CheckInventory("Dukeshotgun") && !CheckInventory("PAPDukeshotgun") && CheckactorInventory(1337,"money") >= 1500 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("Dukeammo", 999);
                    GiveInventory("Dukeclip", 99);
                    GiveInventory("Dukeshotgun",1);
                    takeActorInventory(1337,"money",1500);
                    SetWeapon("Dukeshotgun");
                }   
                else if(!CheckInventory("Dukeshotgun") && !CheckInventory("PAPDukeshotgun") && CheckactorInventory(1337,"money") >= 1500 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") >=1 && checkactorinventory(1337,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("Dukeammo", 999);
                    GiveInventory("Dukeclip", 99);
                    GiveInventory("Dukeshotgun",1);
                    takeActorInventory(1337,"money",1500);
                    SetWeapon("Dukeshotgun");
                }
                else if(!CheckInventory("Dukeshotgun") && !CheckInventory("PAPDukeshotgun") && CheckactorInventory(1337,"money") >= 1500 && P1MK==0 && checkactorinventory(1337,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("Dukeammo", 999);
                    GiveInventory("Dukeclip", 99);
                    GiveInventory("Dukeshotgun",1);
                    takeActorInventory(1337,"money",1500);
                    SetWeapon("Dukeshotgun");
                }
                else if(!CheckInventory("Dukeshotgun") && !CheckInventory("PAPDukeshotgun") && CheckactorInventory(1337,"money") >= 1500 && P1MK==1 && checkactorinventory(1337,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(671,0,0,0,0);
				  delay(5);
				  takeactorinventory(1337,takeweaponp1,1);
                    GiveInventory("Dukeammo", 999);
                    GiveInventory("Dukeclip", 99);
                    GiveInventory("Dukeshotgun",1);
                    takeActorInventory(1337,"money",1500);
                    SetWeapon("Dukeshotgun");
                }             
     }
   }
   else if(activatorTID()==1338)
   {
if(gun2id==1)
     {
                if(checkinventory("PAPMP40") && CheckactorInventory(1338,"money") >= 4500)
                {
                        GiveInventory("PAPMP40ammo", 999);
                        GiveInventory("PAPMP40clip", 99);
                        takeActorInventory(1338,"money",4500);
                }
                else if(CheckInventory("MP40") && CheckactorInventory(1338,"money") >= 500)
                {
                        GiveInventory("MP40ammo", 999);
                        GiveInventory("MP40clip", 99);
                        takeActorInventory(1338,"money",500);
                }
                else if(!CheckInventory("MP40") && !CheckInventory("PAPMP40") && CheckactorInventory(1338,"money") >= 1000 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("MP40ammo", 999);
                    GiveInventory("MP40clip", 99);
                    GiveInventory("MP40",1);
                    GiveInventory("MuleKickMaxWeapons",1);
                    takeActorInventory(1338,"money",1000);
                    SetWeapon("MP40");
                }
                else if(!CheckInventory("MP40") && !CheckInventory("PAPMP40") && CheckactorInventory(1338,"money") >= 1000 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") >=1 && checkactorinventory(1338,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("MP40ammo", 999);
                    GiveInventory("MP40clip", 99);
                    GiveInventory("MP40",1);
                    GiveInventory("MuleKickMaxWeapons",1);
                    takeActorInventory(1338,"money",1000);
                    SetWeapon("MP40");
                }
                else if(!CheckInventory("MP40") && !CheckInventory("PAPMP40") && CheckactorInventory(1338,"money") >= 1000 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("MP40ammo", 999);
                    GiveInventory("MP40clip", 99);
                    GiveInventory("MP40",1);
                    takeActorInventory(1338,"money",1000);
                    SetWeapon("MP40");
                }
                else if(!CheckInventory("MP40") && !CheckInventory("PAPMP40") && CheckactorInventory(1338,"money") >= 1000 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("MP40ammo", 999);
                    GiveInventory("MP40clip", 99);
                    GiveInventory("MP40",1);
                    takeActorInventory(1338,"money",1000);
                    SetWeapon("MP40");
                }

     }
     else if(gun2id==2)
     {
                 if(checkinventory("PAPChaingun") && CheckactorInventory(1338,"money") >= 4500)
                {
                        GiveInventory("PAPChaingunammo", 999);
                        GiveInventory("PAPChaingunclip", 99);
                        takeActorInventory(1338,"money",4500);
                }
                 else if(CheckInventory("normalChaingun") && CheckactorInventory(1338,"money") >= 500)
                {
                        GiveInventory("Chaingunammo", 999);
                        GiveInventory("Chaingunclip", 99);
                        takeActorInventory(1338,"money",500);
                }
                else if(!CheckInventory("normalChaingun") && !CheckInventory("PAPChaingun") && CheckactorInventory(1338,"money") >= 1000 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("Chaingunammo", 999);
                    GiveInventory("Chaingunclip", 99);
                    GiveInventory("normalChaingun",1);
                    GiveInventory("MuleKickMaxWeapons",1);
                    takeActorInventory(1338,"money",1000);
                    SetWeapon("normalChaingun");
                }
                else if(!CheckInventory("normalChaingun") && !CheckInventory("PAPChaingun") && CheckactorInventory(1338,"money") >= 1000 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") >=1 && checkactorinventory(1338,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("Chaingunammo", 999);
                    GiveInventory("Chaingunclip", 99);
                    GiveInventory("normalChaingun",1);
                    GiveInventory("MuleKickMaxWeapons",1);
                    takeActorInventory(1338,"money",1000);
                    SetWeapon("normalChaingun");
                }
                else if(!CheckInventory("normalChaingun") && !CheckInventory("PAPChaingun") && CheckactorInventory(1338,"money") >= 1000 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("Chaingunammo", 999);
                    GiveInventory("Chaingunclip", 99);
                    GiveInventory("normalChaingun",1);
                    takeActorInventory(1338,"money",1000);
                    SetWeapon("normalChaingun");
                }
                else if(!CheckInventory("normalChaingun") && !CheckInventory("PAPChaingun") && CheckactorInventory(1338,"money") >= 1000 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("Chaingunammo", 999);
                    GiveInventory("Chaingunclip", 99);
                    GiveInventory("normalChaingun",1);
                    takeActorInventory(1338,"money",1000);
                    SetWeapon("normalChaingun");
                }
     }
     else if(gun2id==3)
     {
           if(CheckInventory("normalshotgun") || checkinventory("PAPshotgun") && CheckactorInventory(1338,"money") >= 250)
                {
                        GiveInventory("shotgunammo", 999);
                        GiveInventory("shotgunclip", 99);
                        takeActorInventory(1338,"money",250);
                }
                else if(!CheckInventory("normalshotgun") && !CheckInventory("PAPshotgun") && CheckactorInventory(1338,"money") >= 500 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("shotgunammo", 999);
                    GiveInventory("shotgunclip", 99);
                    GiveInventory("normalshotgun",1);
                    takeActorInventory(1338,"money",500);
                    SetWeapon("normalshotgun");
                }     
                else if(!CheckInventory("normalshotgun") && !CheckInventory("PAPshotgun") && CheckactorInventory(1338,"money") >= 500 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") >=1 && checkactorinventory(1338,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("shotgunammo", 999);
                    GiveInventory("shotgunclip", 99);
                    GiveInventory("normalshotgun",1);
                    takeActorInventory(1338,"money",500);
                    SetWeapon("normalshotgun");
                }
                else if(!CheckInventory("normalshotgun") && !CheckInventory("PAPshotgun") && CheckactorInventory(1338,"money") >= 500 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("shotgunammo", 999);
                    GiveInventory("shotgunclip", 99);
                    GiveInventory("normalshotgun",1);
                    takeActorInventory(1338,"money",500);
                    SetWeapon("normalshotgun");
                }
                else if(!CheckInventory("normalshotgun") && !CheckInventory("PAPshotgun") && CheckactorInventory(1338,"money") >= 500 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("shotgunammo", 999);
                    GiveInventory("shotgunclip", 99);
                    GiveInventory("normalshotgun",1);
                    takeActorInventory(1338,"money",500);
                    SetWeapon("normalshotgun");
                }
     }
     else if(gun2id==4)
     {
           if(CheckInventory("SSG") || checkinventory("PAPSSG") && CheckactorInventory(1338,"money") >= 750)
                {
                        GiveInventory("SSGammo", 999);
                        GiveInventory("SSGclip", 99);
                        takeActorInventory(1338,"money",750);
                }
                else if(!CheckInventory("SSG") && !CheckInventory("PAPSSG") && CheckactorInventory(1338,"money") >= 1500 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("SSGammo", 999);
                    GiveInventory("SSGclip", 99);
                    GiveInventory("SSG",1);
                    takeActorInventory(1338,"money",1500);
                    SetWeapon("SSG");
                }   
                else if(!CheckInventory("SSG") && !CheckInventory("PAPSSG") && CheckactorInventory(1338,"money") >= 1500 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") >=1 && checkactorinventory(1338,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("SSGammo", 999);
                    GiveInventory("SSGclip", 99);
                    GiveInventory("SSG",1);
                    takeActorInventory(1338,"money",1500);
                    SetWeapon("SSG");
                }
                else if(!CheckInventory("SSG") && !CheckInventory("PAPSSG") && CheckactorInventory(1338,"money") >= 1500 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("SSGammo", 999);
                    GiveInventory("SSGclip", 99);
                    GiveInventory("SSG",1);
                    takeActorInventory(1338,"money",1500);
                    SetWeapon("SSG");
                }
                else if(!CheckInventory("SSG") && !CheckInventory("PAPSSG") && CheckactorInventory(1338,"money") >= 1500 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("SSGammo", 999);
                    GiveInventory("SSGclip", 99);
                    GiveInventory("SSG",1);
                    takeActorInventory(1338,"money",1500);
                    SetWeapon("SSG");
                }       
     }
     else if(gun2id==5)
     {
                if(CheckactorInventory(1338,"money") >= 500)
                {
                        GiveInventory("grenadeammo", 4);
                        takeActorInventory(1338,"money",500);
                }        
     }
     else if(gun2id==6)
     {
                if(checkinventory("PAPMP5") && CheckactorInventory(1338,"money") >= 4500)
                {
                        GiveInventory("PAPMP5ammo", 999);
                        GiveInventory("PAPMP5clip", 99);
                        takeActorInventory(1338,"money",4500);
                }
                else if(CheckInventory("MP5") && CheckactorInventory(1338,"money") >= 500)
                {
                        GiveInventory("MP5ammo", 999);
                        GiveInventory("MP5clip", 99);
                        takeActorInventory(1338,"money",500);
                }
                else if(!CheckInventory("MP5") && !CheckInventory("PAPMP5") && CheckactorInventory(1338,"money") >= 1000 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("MP5ammo", 999);
                    GiveInventory("MP5clip", 99);
                    GiveInventory("MP5",1);
                    takeActorInventory(1338,"money",1000);
                    SetWeapon("MP5");
                }    
                else if(!CheckInventory("MP5") && !CheckInventory("PAPMP5") && CheckactorInventory(1338,"money") >= 1000 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") >=1 && checkactorinventory(1338,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("MP5ammo", 999);
                    GiveInventory("MP5clip", 99);
                    GiveInventory("MP5",1);
                    takeActorInventory(1338,"money",1000);
                    SetWeapon("MP5");
                }
                else if(!CheckInventory("MP5") && !CheckInventory("PAPMP5") && CheckactorInventory(1338,"money") >= 1000 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("MP5ammo", 999);
                    GiveInventory("MP5clip", 99);
                    GiveInventory("MP5",1);
                    takeActorInventory(1338,"money",1000);
                    SetWeapon("MP5");
                }
                else if(!CheckInventory("MP5") && !CheckInventory("PAPMP5") && CheckactorInventory(1338,"money") >= 1000 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("MP5ammo", 999);
                    GiveInventory("MP5clip", 99);
                    GiveInventory("MP5",1);
                    takeActorInventory(1338,"money",1000);
                    SetWeapon("MP5");
                }    
     }
     else if(gun2id==7)
     {
                if(checkinventory("PAPM16") && CheckactorInventory(1338,"money") >= 4500)
                {
                        GiveInventory("PAPM16ammo", 999);
                        GiveInventory("PAPM16clip", 99);
                        takeActorInventory(1338,"money",4500);
                }
                else if(CheckInventory("M16") && CheckactorInventory(1338,"money") >= 600)
                {
                        GiveInventory("M16ammo", 999);
                        GiveInventory("M16clip", 99);
                        takeActorInventory(1338,"money",600);
                }
                else if(!CheckInventory("M16") && !CheckInventory("PAPM16") && CheckactorInventory(1338,"money") >= 1200 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("M16ammo", 999);
                    GiveInventory("M16clip", 99);
                    GiveInventory("M16",1);
                    takeActorInventory(1338,"money",1200);
                    SetWeapon("M16");
                }     
                else if(!CheckInventory("M16") && !CheckInventory("PAPM16") && CheckactorInventory(1338,"money") >= 1200 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") >=1 && checkactorinventory(1338,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("M16ammo", 999);
                    GiveInventory("M16clip", 99);
                    GiveInventory("M16",1);
                    takeActorInventory(1338,"money",1200);
                    SetWeapon("M16");
                }
                else if(!CheckInventory("M16") && !CheckInventory("PAPM16") && CheckactorInventory(1338,"money") >= 1200 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("M16ammo", 999);
                    GiveInventory("M16clip", 99);
                    GiveInventory("M16",1);
                    takeActorInventory(1338,"money",1200);
                    SetWeapon("M16");
                }
                else if(!CheckInventory("M16") && !CheckInventory("PAPM16") && CheckactorInventory(1338,"money") >= 1200 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("M16ammo", 999);
                    GiveInventory("M16clip", 99);
                    GiveInventory("M16",1);
                    takeActorInventory(1338,"money",1200);
                    SetWeapon("M16");
                }     
     }
     else if(gun2id==8)
     {
                if(CheckactorInventory(1338,"money") >= 1000 && p2claysBought==0)
                {
                        //GiveInventory("Claymoreammo", 2);
                        //giveactorinventory(1338,"ClaymoreMine",1);
                        //takeActorInventory(1338,"money",1000);
						              // p2claysBought=1;
                }      
     }
     else if(gun2id==9)
     {
                if(checkinventory("PAPM1") && CheckactorInventory(1338,"money") >= 4500)
                {
                        GiveInventory("PAPM1ammo", 999);
                        GiveInventory("PAPM1clip", 99);
                        takeActorInventory(1338,"money",4500);
                }
                else if(CheckInventory("M1") && CheckactorInventory(1338,"money") >= 250)
                {
                        GiveInventory("M1ammo", 999);
                        GiveInventory("M1clip", 99);
                        takeActorInventory(1338,"money",250);
                }
                else if(!CheckInventory("M1") && !CheckInventory("PAPM1") && CheckactorInventory(1338,"money") >= 500 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("M1ammo", 999);
                    GiveInventory("M1clip", 99);
                    GiveInventory("M1",1);
                    takeActorInventory(1338,"money",500);
                    SetWeapon("M1");
                }   
                else if(!CheckInventory("M1") && !CheckInventory("PAPM1") && CheckactorInventory(1338,"money") >= 500 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") >=1 && checkactorinventory(1338,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("M1ammo", 999);
                    GiveInventory("M1clip", 99);
                    GiveInventory("M1",1);
                    takeActorInventory(1338,"money",500);
                    SetWeapon("M1");
                }
                else if(!CheckInventory("M1") && !CheckInventory("PAPM1") && CheckactorInventory(1338,"money") >= 500 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("M1ammo", 999);
                    GiveInventory("M1clip", 99);
                    GiveInventory("M1",1);
                    takeActorInventory(1338,"money",500);
                    SetWeapon("M1");
                }
                else if(!CheckInventory("M1") && !CheckInventory("PAPM1") && CheckactorInventory(1338,"money") >= 500 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("M1ammo", 999);
                    GiveInventory("M1clip", 99);
                    GiveInventory("M1",1);
                    takeActorInventory(1338,"money",500);
                    SetWeapon("M1");
                }       
     }
     else if(gun2id==10)
     {
       //Player 1
            if(checkactorinventory(1338,"Machete")==0 && CheckactorInventory(1338,"money") >= 3000)
            {
                        giveactorinventory(1338,"Machete",1);
                        takeActorInventory(1338,"money",3000);
            }
     }
     else if(gun2id==11)
     {
                if(checkinventory("PAPThomson") && CheckactorInventory(1338,"money") >= 4500)
                {
                        GiveInventory("PAPThomsonammo", 999);
                        GiveInventory("PAPThomsonclip", 99);
                        takeActorInventory(1338,"money",4500);
                }
                else if(CheckInventory("Thomson") && CheckactorInventory(1338,"money") >= 600)
                {
                        GiveInventory("Thomsonammo", 999);
                        GiveInventory("Thomsonclip", 99);
                        takeActorInventory(1338,"money",600);
                }
                else if(!CheckInventory("Thomson") && !CheckInventory("PAPThomson") && CheckactorInventory(1338,"money") >= 1200 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 1)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("Thomsonammo", 999);
                    GiveInventory("Thomsonclip", 99);
                    GiveInventory("Thomson",1);
                    takeActorInventory(1338,"money",1200);
                    SetWeapon("Thomson");
                }   
                else if(!CheckInventory("Thomson") && !CheckInventory("PAPThomson") && CheckactorInventory(1338,"money") >= 1200 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") >=1 && checkactorinventory(1338,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("Thomsonammo", 999);
                    GiveInventory("Thomsonclip", 99);
                    GiveInventory("Thomson",1);
                    takeActorInventory(1338,"money",1200);
                    SetWeapon("Thomson");
                }
                else if(!CheckInventory("Thomson") && !CheckInventory("PAPThomson") && CheckactorInventory(1338,"money") >= 1200 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("Thomsonammo", 999);
                    GiveInventory("Thomsonclip", 99);
                    GiveInventory("Thomson",1);
                    takeActorInventory(1338,"money",1200);
                    SetWeapon("Thomson");
                }
                else if(!CheckInventory("Thomson") && !CheckInventory("PAPThomson") && CheckactorInventory(1338,"money") >= 1200 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("Thomsonammo", 999);
                    GiveInventory("Thomsonclip", 99);
                    GiveInventory("Thomson",1);
                    takeActorInventory(1338,"money",1200);
                    SetWeapon("Thomson");
                }          
     }
     else if(gun2id==12)
     {
       //Player 1
            if(CheckactorInventory(1338,"money") >= 2250)
            {
                        giveactorinventory(1338,"Megasphere",1);
                        takeActorInventory(1338,"money",2250);
            }
     }
     else if(gun2id==13)
     {
                if(checkinventory("PAPDukeshotgun") && CheckactorInventory(1338,"money") >= 4500)
                {
                        GiveInventory("PAPDukeammo", 999);
                        GiveInventory("PAPDukeclip", 99);
                        takeActorInventory(1338,"money",4500);
                }
                else if(CheckInventory("Dukeshotgun") && CheckactorInventory(1338,"money") >= 750)
                {
                        GiveInventory("Dukeammo", 999);
                        GiveInventory("Dukeclip", 99);
                        takeActorInventory(1338,"money",750);
                }
                else if(!CheckInventory("Dukeshotgun") && !CheckInventory("PAPDukeshotgun") && CheckactorInventory(1338,"money") >= 1500 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 1)
                {
				GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("Dukeammo", 999);
                    GiveInventory("Dukeclip", 99);
                    GiveInventory("Dukeshotgun",1);
                    takeActorInventory(1338,"money",1500);
                    SetWeapon("Dukeshotgun");
                }   
                else if(!CheckInventory("Dukeshotgun") && !CheckInventory("PAPDukeshotgun") && CheckactorInventory(1338,"money") >= 1500 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") >=1 && checkactorinventory(1338,"MuleKickMaxWeapons") < 3)
                {
                    GiveInventory("MuleKickMaxWeapons",1);
                    GiveInventory("Dukeammo", 999);
                    GiveInventory("Dukeclip", 99);
                    GiveInventory("Dukeshotgun",1);
                    takeActorInventory(1338,"money",1500);
                    SetWeapon("Dukeshotgun");
                }
                else if(!CheckInventory("Dukeshotgun") && !CheckInventory("PAPDukeshotgun") && CheckactorInventory(1338,"money") >= 1500 && p2MK==0 && checkactorinventory(1338,"MuleKickMaxWeapons") == 2)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("Dukeammo", 999);
                    GiveInventory("Dukeclip", 99);
                    GiveInventory("Dukeshotgun",1);
                    takeActorInventory(1338,"money",1500);
                    SetWeapon("Dukeshotgun");
                }
                else if(!CheckInventory("Dukeshotgun") && !CheckInventory("PAPDukeshotgun") && CheckactorInventory(1338,"money") >= 1500 && p2MK==1 && checkactorinventory(1338,"MuleKickMaxWeapons") == 3)
                {
				  acs_executeAlways(672,0,0,0,0);
				  delay(5);
				  takeactorinventory(1338,takeweaponp2,1);
                    GiveInventory("Dukeammo", 999);
                    GiveInventory("Dukeclip", 99);
                    GiveInventory("Dukeshotgun",1);
                    takeActorInventory(1338,"money",1500);
                    SetWeapon("Dukeshotgun");
                }             
     }
   }
}

script 671 (void)
{
if(checkweapon("Hal's_Smartgun")){takeweaponp1 ="Hal's_Smartgun";}
Else if(checkweapon("Smartgun")){takeweaponp1 ="Smartgun";}
Else if(checkweapon("Doom3shotgun")){takeweaponp1 ="Doom3shotgun";}
Else if(checkweapon("Flaregun")){takeweaponp1 = "Flaregun";}
Else if(checkweapon("PAPFlaregun")){takeweaponp1 ="PAPFlaregun";}
Else if(checkweapon("PAPDoom3shotgun")){takeweaponp1 ="PAPDoom3shotgun";}
Else if(checkweapon("PPSH-41")){takeweaponp1 ="PPSH-41";}
Else if(checkweapon("PAPPPSH-41")){takeweaponp1 ="PAPPPSH-41";}
Else if(checkweapon("RPG")){takeweaponp1 ="RPG";}
Else if(checkweapon("PAPRPG")){takeweaponp1 ="PAPRPG";}
Else if(checkweapon("Chainsaw2")){takeweaponp1 ="Chainsaw2";}
Else if(checkweapon("DoubleBladedChainsaw")){takeweaponp1 ="DoubleBladedChainsaw";}
Else if(checkweapon("Raygun")){takeweaponp1 ="Raygun";}
Else if(checkweapon("PAPRaygun")){takeweaponp1 ="PAPRaygun";}
Else if(checkweapon("BloodTommygun")){takeweaponp1 ="BloodTommygun";}
Else if(checkweapon("PAPBloodTommygun")){takeweaponp1 ="PAPBloodTommygun";}
Else if(checkweapon("NormalPistol")){takeweaponp1 ="NormalPistol";}
Else if(checkweapon("PAPPistol")){takeweaponp1 ="PAPPistol";}
Else if(checkweapon("Colt45")){takeweaponp1 ="Colt45";}
Else if(checkweapon("PAPColt45")){takeweaponp1 ="PAPColt45";}
Else if(checkweapon("MP7")){takeweaponp1 ="MP7";}
Else if(checkweapon("PAPMP7")){takeweaponp1 ="PAPMP7";}
Else if(checkweapon("NormalShotgun")){takeweaponp1 ="NormalShotgun";} 
Else if(checkweapon("PAPShotgun")){takeweaponp1 ="PAPShotgun";}
Else if(checkweapon("SSG")){takeweaponp1 ="SSG";}
Else if(checkweapon("PAPSSG")){takeweaponp1 ="PAPSSG";}
Else if(checkweapon("Dukeshotgun")){takeweaponp1 ="Dukeshotgun";}
Else if(checkweapon("PAPDukeshotgun")){takeweaponp1 ="PAPDukeshotgun";}
Else if(checkweapon("NormalChaingun")){takeweaponp1 ="NormalChaingun";}
Else if(checkweapon("PAPChaingun")){takeweaponp1 ="PAPChaingun";}
Else if(checkweapon("M16")){takeweaponp1 ="M16";}
Else if(checkweapon("PAPM16")){takeweaponp1 ="PAPM16";}
Else if(checkweapon("MP5")){takeweaponp1 ="MP5";}
Else if(checkweapon("PAPMP5")){takeweaponp1 ="PAPMP5";}
Else if(checkweapon("AUG")){takeweaponp1 ="AUG";}
Else if(checkweapon("PAPAUG")){takeweaponp1 ="PAPAUG";}
Else if(checkweapon("SpellBinder")){takeweaponp1 ="SpellBinder";}
Else if(checkweapon("PAPSpellBinder")){takeweaponp1 ="PAPSpellBinder";}
Else if(checkweapon("Uzi")){takeweaponp1 ="Uzi";}
Else if(checkweapon("PAPUzi")){takeweaponp1 ="PAPUzi";}
Else if(checkweapon("Dualuzis")){takeweaponp1 ="Dualuzis";}
Else if(checkweapon("PAPDualuzis")){takeweaponp1 ="PAPDualuzis";}
Else if(checkweapon("MP40")){takeweaponp1 ="MP40";}
Else if(checkweapon("PAPMP40")){takeweaponp1 ="PAPMP40";}
Else if(checkweapon("M1")){takeweaponp1 ="M1";}
Else if(checkweapon("PAPM1")){takeweaponp1 ="PAPM1";}
Else if(checkweapon("FAMAS")){takeweaponp1 ="FAMAS";}
Else if(checkweapon("PAPFAMAS")){takeweaponp1 ="PAPFAMAS";}
Else if(checkweapon("UAC_machinegun")){takeweaponp1 ="UAC_machinegun";} 
Else if(checkweapon("PAPUAC_machinegun")){takeweaponp1 ="PAPUAC_machinegun";}
Else if(checkweapon("Rifle")){takeweaponp1 ="Rifle";}
Else if(checkweapon("PAPRifle")){takeweaponp1 ="PAPRifle";}
Else if(checkweapon("AK47")){takeweaponp1 ="AK47";}
Else if(checkweapon("PAPAK47")){takeweaponp1 ="PAPAK47";}
Else if(checkweapon("Thomson")){takeweaponp1 ="Thomson";}
Else if(checkweapon("PAPThomson")){takeweaponp1 ="PAPThomson";}
Else if(checkweapon("Quadshotgun")){takeweaponp1 ="Quadshotgun";}
Else if(checkweapon("PAPQuadshotgun")){takeweaponp1 ="PAPQuadshotgun";}
Else if(checkweapon("PlasmaGun")){takeweaponp1 ="PlasmaGun";}
Else if(checkweapon("PAPPlasmaGun")){takeweaponp1 ="PAPPlasmaGun";}
Else if(checkweapon("PlasmaBeam")){takeweaponp1 ="PlasmaBeam";}
Else if(checkweapon("PAPPlasmaBeam")){takeweaponp1 ="PAPPlasmaBeam";}
Else if(checkweapon("BFG_9000")){takeweaponp1 ="BFG_9000";}
Else if(checkweapon("PAPBFG_9000")){takeweaponp1 ="PAPBFG_9000";}
Else if(checkweapon("STBFG10K")){takeweaponp1 ="STBFG10K";}
Else if(checkweapon("PAPSTBFG10K")){takeweaponp1 ="PAPSTBFG10K";}
Else if(checkweapon("AA12")){takeweaponp1 ="AA12";}
Else if(checkweapon("PAPAA12")){takeweaponp1 ="PAPAA12";}
Else if(checkweapon("ClaymoreMine")){takeweaponp1 ="ClaymoreMine";}
Else if(checkweapon("BAR")){takeweaponp1 ="BAR";}
Else if(checkweapon("PAPBAR")){takeweaponp1 ="PAPBAR";}
Else if(checkweapon("Model1887")){takeweaponp1 ="Model1887";}
Else if(checkweapon("Model115")){takeweaponp1 ="Model115";}
Else if(checkweapon("PumpActionShotgun")){takeweaponp1 ="PumpActionShotgun";} 
Else if(checkweapon("PAPPumpActionShotgun")){takeweaponp1 ="PAPPumpActionShotgun";}
Else if(checkweapon("Revolver")){takeweaponp1 ="Revolver";}
Else if(checkweapon("PAPRevolver")){takeweaponp1 ="PAPRevolver";}
Else if(checkweapon("Scar-H")){takeweaponp1 ="Scar-H";}
Else if(checkweapon("PAPScar-H")){takeweaponp1 ="PAPScar-H";}
Else if(checkweapon("STG-44")){takeweaponp1 ="STG-44";}
Else if(checkweapon("Spatz-447")){takeweaponp1 ="Spatz-447";}
Else if(checkweapon("Raygunmark2")){takeweaponp1 ="Raygunmark2";}
Else if(checkweapon("PAPRaygunmark2")){takeweaponp1 ="PAPRaygunmark2";}
Else if(checkweapon("PulseMachinegun")){takeweaponp1 ="PulseMachinegun";}
Else if(checkweapon("PAPPulseMachinegun")){takeweaponp1 ="PAPPulseMachinegun";}
}

script 672 (void)
{
if(checkweapon("Hal's_Smartgun")){takeweaponp2 ="Hal's_Smartgun";}
Else if(checkweapon("Smartgun")){takeweaponp2 ="Smartgun";}
Else if(checkweapon("Doom3shotgun")){takeweaponp2 ="Doom3shotgun";}
Else if(checkweapon("Flaregun")){takeweaponp2 = "Flaregun";}
Else if(checkweapon("PAPFlaregun")){takeweaponp2 ="PAPFlaregun";}
Else if(checkweapon("PAPDoom3shotgun")){takeweaponp2 ="PAPDoom3shotgun";}
Else if(checkweapon("PPSH-41")){takeweaponp2 ="PPSH-41";}
Else if(checkweapon("PAPPPSH-41")){takeweaponp2 ="PAPPPSH-41";}
Else if(checkweapon("RPG")){takeweaponp2 ="RPG";}
Else if(checkweapon("PAPRPG")){takeweaponp2 ="PAPRPG";}
Else if(checkweapon("Chainsaw2")){takeweaponp2 ="Chainsaw2";}
Else if(checkweapon("DoubleBladedChainsaw")){takeweaponp2 ="DoubleBladedChainsaw";}
Else if(checkweapon("Raygun")){takeweaponp2 ="Raygun";}
Else if(checkweapon("PAPRaygun")){takeweaponp2 ="PAPRaygun";}
Else if(checkweapon("BloodTommygun")){takeweaponp2 ="BloodTommygun";}
Else if(checkweapon("PAPBloodTommygun")){takeweaponp2 ="PAPBloodTommygun";}
Else if(checkweapon("NormalPistol")){takeweaponp2 ="NormalPistol";}
Else if(checkweapon("PAPPistol")){takeweaponp2 ="PAPPistol";}
Else if(checkweapon("Colt45")){takeweaponp2 ="Colt45";}
Else if(checkweapon("PAPColt45")){takeweaponp2 ="PAPColt45";}
Else if(checkweapon("MP7")){takeweaponp2 ="MP7";}
Else if(checkweapon("PAPMP7")){takeweaponp2 ="PAPMP7";}
Else if(checkweapon("NormalShotgun")){takeweaponp2 ="NormalShotgun";} 
Else if(checkweapon("PAPShotgun")){takeweaponp2 ="PAPShotgun";}
Else if(checkweapon("SSG")){takeweaponp2 ="SSG";}
Else if(checkweapon("PAPSSG")){takeweaponp2 ="PAPSSG";}
Else if(checkweapon("Dukeshotgun")){takeweaponp2 ="Dukeshotgun";}
Else if(checkweapon("PAPDukeshotgun")){takeweaponp2 ="PAPDukeshotgun";}
Else if(checkweapon("NormalChaingun")){takeweaponp2 ="NormalChaingun";}
Else if(checkweapon("PAPChaingun")){takeweaponp2 ="PAPChaingun";}
Else if(checkweapon("M16")){takeweaponp2 ="M16";}
Else if(checkweapon("PAPM16")){takeweaponp2 ="PAPM16";}
Else if(checkweapon("MP5")){takeweaponp2 ="MP5";}
Else if(checkweapon("PAPMP5")){takeweaponp2 ="PAPMP5";}
Else if(checkweapon("AUG")){takeweaponp2 ="AUG";}
Else if(checkweapon("PAPAUG")){takeweaponp2 ="PAPAUG";}
Else if(checkweapon("SpellBinder")){takeweaponp2 ="SpellBinder";}
Else if(checkweapon("PAPSpellBinder")){takeweaponp2 ="PAPSpellBinder";}
Else if(checkweapon("Uzi")){takeweaponp2 ="Uzi";}
Else if(checkweapon("PAPUzi")){takeweaponp2 ="PAPUzi";}
Else if(checkweapon("Dualuzis")){takeweaponp2 ="Dualuzis";}
Else if(checkweapon("PAPDualuzis")){takeweaponp2 ="PAPDualuzis";}
Else if(checkweapon("MP40")){takeweaponp2 ="MP40";}
Else if(checkweapon("PAPMP40")){takeweaponp2 ="PAPMP40";}
Else if(checkweapon("M1")){takeweaponp2 ="M1";}
Else if(checkweapon("PAPM1")){takeweaponp2 ="PAPM1";}
Else if(checkweapon("FAMAS")){takeweaponp2 ="FAMAS";}
Else if(checkweapon("PAPFAMAS")){takeweaponp2 ="PAPFAMAS";}
Else if(checkweapon("UAC_machinegun")){takeweaponp2 ="UAC_machinegun";} 
Else if(checkweapon("PAPUAC_machinegun")){takeweaponp2 ="PAPUAC_machinegun";}
Else if(checkweapon("Rifle")){takeweaponp2 ="Rifle";}
Else if(checkweapon("PAPRifle")){takeweaponp2 ="PAPRifle";}
Else if(checkweapon("AK47")){takeweaponp2 ="AK47";}
Else if(checkweapon("PAPAK47")){takeweaponp2 ="PAPAK47";}
Else if(checkweapon("Thomson")){takeweaponp2 ="Thomson";}
Else if(checkweapon("PAPThomson")){takeweaponp2 ="PAPThomson";}
Else if(checkweapon("Quadshotgun")){takeweaponp2 ="Quadshotgun";}
Else if(checkweapon("PAPQuadshotgun")){takeweaponp2 ="PAPQuadshotgun";}
Else if(checkweapon("PlasmaGun")){takeweaponp2 ="PlasmaGun";}
Else if(checkweapon("PAPPlasmaGun")){takeweaponp2 ="PAPPlasmaGun";}
Else if(checkweapon("PlasmaBeam")){takeweaponp2 ="PlasmaBeam";}
Else if(checkweapon("PAPPlasmaBeam")){takeweaponp2 ="PAPPlasmaBeam";}
Else if(checkweapon("BFG_9000")){takeweaponp2 ="BFG_9000";}
Else if(checkweapon("PAPBFG_9000")){takeweaponp2 ="PAPBFG_9000";}
Else if(checkweapon("STBFG10K")){takeweaponp2 ="STBFG10K";}
Else if(checkweapon("PAPSTBFG10K")){takeweaponp2 ="PAPSTBFG10K";}
Else if(checkweapon("AA12")){takeweaponp2 ="AA12";}
Else if(checkweapon("PAPAA12")){takeweaponp2 ="PAPAA12";}
Else if(checkweapon("ClaymoreMine")){takeweaponp2 ="ClaymoreMine";}
Else if(checkweapon("BAR")){takeweaponp2 ="BAR";}
Else if(checkweapon("PAPBAR")){takeweaponp2 ="PAPBAR";}
Else if(checkweapon("Model1887")){takeweaponp2 ="Model1887";}
Else if(checkweapon("Model115")){takeweaponp2 ="Model115";}
Else if(checkweapon("PumpActionShotgun")){takeweaponp2 ="PumpActionShotgun";} 
Else if(checkweapon("PAPPumpActionShotgun")){takeweaponp2 ="PAPPumpActionShotgun";}
Else if(checkweapon("Revolver")){takeweaponp2 ="Revolver";}
Else if(checkweapon("PAPRevolver")){takeweaponp2 ="PAPRevolver";}
Else if(checkweapon("Scar-H")){takeweaponp2 ="Scar-H";}
Else if(checkweapon("PAPScar-H")){takeweaponp2 ="PAPScar-H";}
Else if(checkweapon("STG-44")){takeweaponp2 ="STG-44";}
Else if(checkweapon("Spatz-447")){takeweaponp2 ="Spatz-447";}
Else if(checkweapon("PulseMachinegun")){takeweaponp2 ="PulseMachinegun";}
Else if(checkweapon("PAPPulseMachinegun")){takeweaponp2 ="PAPPulseMachinegun";}
Else if(checkweapon("Raygunmark2")){takeweaponp2 ="Raygunmark2";}
Else if(checkweapon("PAPRaygunmark2")){takeweaponp2 ="PAPRaygunmark2";}
} 

script 673 (void)
{
    HudMessage(s:"Max Weapons Reached use the drop currect weapon command to remove gun and pick this up\n\ do not use drop weapon from doom use the one from doom zombies 2";
                HUDMSG_PLAIN, 101+playernumber(), CR_green, 0.50, 0.80, 2.0);
}

script 674 (void)
{
if(checkweapon("Hal's_Smartgun")){TakeInventory("Hal's_Smartgun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Smartgun")){TakeInventory("Smartgun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Doom3shotgun")){TakeInventory("Doom3shotgun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Flaregun")){TakeInventory( "Flaregun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPFlaregun")){TakeInventory("PAPFlaregun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPDoom3shotgun")){TakeInventory("PAPDoom3shotgun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PPSH-41")){TakeInventory("PPSH-41",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPPPSH-41")){TakeInventory("PAPPPSH-41",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("RPG")){TakeInventory("RPG",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPRPG")){TakeInventory("PAPRPG",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Chainsaw2")){TakeInventory("Chainsaw2",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("DoubleBladedChainsaw")){TakeInventory("DoubleBladedChainsaw",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Raygun")){TakeInventory("Raygun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPRaygun")){TakeInventory("PAPRaygun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("BloodTommygun")){TakeInventory("BloodTommygun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPBloodTommygun")){TakeInventory("PAPBloodTommygun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("NormalPistol")){TakeInventory("NormalPistol",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPPistol")){TakeInventory("PAPPistol",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Colt45")){TakeInventory("Colt45",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPColt45")){TakeInventory("PAPColt45",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("MP7")){TakeInventory("MP7",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPMP7")){TakeInventory("PAPMP7",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("NormalShotgun")){TakeInventory("NormalShotgun",1);takeinventory("mulekickmaxweapons",1);} 
Else if(checkweapon("PAPShotgun")){TakeInventory("PAPShotgun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("SSG")){TakeInventory("SSG",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPSSG")){TakeInventory("PAPSSG",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Dukeshotgun")){TakeInventory("Dukeshotgun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPDukeshotgun")){TakeInventory("PAPDukeshotgun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("NormalChaingun")){TakeInventory("NormalChaingun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPChaingun")){TakeInventory("PAPChaingun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("M16")){TakeInventory("M16",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPM16")){TakeInventory("PAPM16",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("MP5")){TakeInventory("MP5",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPMP5")){TakeInventory("PAPMP5",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("AUG")){TakeInventory("AUG",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPAUG")){TakeInventory("PAPAUG",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("SpellBinder")){TakeInventory("SpellBinder",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPSpellBinder")){TakeInventory("PAPSpellBinder",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Uzi")){TakeInventory("Uzi",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPUzi")){TakeInventory("PAPUzi",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Dualuzis")){TakeInventory("Dualuzis",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPDualuzis")){TakeInventory("PAPDualuzis",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("MP40")){TakeInventory("MP40",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPMP40")){TakeInventory("PAPMP40",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("M1")){TakeInventory("M1",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPM1")){TakeInventory("PAPM1",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("FAMAS")){TakeInventory("FAMAS",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPFAMAS")){TakeInventory("PAPFAMAS",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("UAC_machinegun")){TakeInventory("UAC_machinegun",1);takeinventory("mulekickmaxweapons",1);} 
Else if(checkweapon("PAPUAC_machinegun")){TakeInventory("PAPUAC_machinegun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Rifle")){TakeInventory("Rifle",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPRifle")){TakeInventory("PAPRifle",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("AK47")){TakeInventory("AK47",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPAK47")){TakeInventory("PAPAK47",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Thomson")){TakeInventory("Thomson",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPThomson")){TakeInventory("PAPThomson",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Quadshotgun")){TakeInventory("Quadshotgun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPQuadshotgun")){TakeInventory("PAPQuadshotgun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PlasmaGun")){TakeInventory("PlasmaGun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPPlasmaGun")){TakeInventory("PAPPlasmaGun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PlasmaBeam")){TakeInventory("PlasmaBeam",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPPlasmaBeam")){TakeInventory("PAPPlasmaBeam",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("BFG_9000")){TakeInventory("BFG_9000",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPBFG_9000")){TakeInventory("PAPBFG_9000",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("STBFG10K")){TakeInventory("STBFG10K",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPSTBFG10K")){TakeInventory("PAPSTBFG10K",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("AA12")){TakeInventory("AA12",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPAA12")){TakeInventory("PAPAA12",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("ClaymoreMine")){TakeInventory("ClaymoreMine",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("BAR")){TakeInventory("BAR",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPBAR")){TakeInventory("PAPBAR",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Model1887")){TakeInventory("Model1887",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Model115")){TakeInventory("Model115",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PumpActionShotgun")){TakeInventory("PumpActionShotgun",1);takeinventory("mulekickmaxweapons",1);} 
Else if(checkweapon("PAPPumpActionShotgun")){TakeInventory("PAPPumpActionShotgun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Revolver")){TakeInventory("Revolver",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPRevolver")){TakeInventory("PAPRevolver",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Scar-H")){TakeInventory("Scar-H",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPScar-H")){TakeInventory("PAPScar-H",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("STG-44")){TakeInventory("STG-44",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Spatz-447")){TakeInventory("Spatz-447",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PulseMachinegun")){TakeInventory("PulseMachinegun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPPulseMachinegun")){TakeInventory("PAPPulseMachinegun",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("Raygunmark2")){TakeInventory("Raygunmark2",1);takeinventory("mulekickmaxweapons",1);}
Else if(checkweapon("PAPRaygunmark2")){TakeInventory("PAPRaygunmark2",1);takeinventory("mulekickmaxweapons",1);}
}

function void hudmessageonactor(int tid, int range, str sprite, str text)
{
	int dist, ang, vang, pitch, x, y;
	int HUDX = 640;
	int HUDY = 400;
	int offset = 0;

	if(sprite != -1)
	{
		SetFont(sprite);
		text = "A";
		offset = 0.1;
	}

	SetHudSize(HUDX, HUDY, 1);
	x = GetActorX(tid) - GetActorX(0);
	y = GetActorY(tid) - GetActorY(0); 

	vang = VectorAngle(x,y);
	ang = (vang - GetActorAngle(0) + 1.0) % 1.0;

	if(((vang+0.125)%0.5) > 0.25) dist = FixedDiv(y, sin(vang));
	else dist = FixedDiv(x, cos(vang));

	if ((ang < 0.2 || ang > 0.8) && dist / 65536 < range)
	{
		pitch = VectorAngle(dist, GetActorZ(tid) - (GetActorZ(0) + 41.0));
		pitch = (pitch + GetActorPitch(0) + 1.0) % 1.0;

		x = HUDX/2 - ((HUDX/2) * sin(ang) / cos(ang));
		y = HUDY/2 - ((HUDX/2) * sin(pitch) / cos(pitch));

		HudMessage(s:text; HUDMSG_PLAIN, 1, CR_UNTRANSLATED, (x<<16)+offset, (y<<16)+offset, 0);
	}
	else
		HudMessage(s:""; HUDMSG_PLAIN, 1, CR_UNTRANSLATED, 0, 0, 0);
}

function void Removeweaponsp1(void)
{
takeactorinventory(1337,"Hal's_Smartgun",1); 
takeactorinventory(1337,"Smartgun",1); 
takeactorinventory(1337,"Doom3shotgun",1); 
takeactorinventory(1337,"Flaregun",1);  
takeactorinventory(1337,"PAPFlaregun",1); 
takeactorinventory(1337,"PAPDoom3shotgun",1); 
takeactorinventory(1337,"PPSH-41",1); 
takeactorinventory(1337,"PAPPPSH-41",1); 
takeactorinventory(1337,"RPG",1); 
takeactorinventory(1337,"PAPRPG",1); 
takeactorinventory(1337,"Chainsaw2",1); 
takeactorinventory(1337,"DoubleBladedChainsaw",1); 
takeactorinventory(1337,"Raygun",1); 
takeactorinventory(1337,"PAPRaygun",1); 
takeactorinventory(1337,"BloodTommygun",1); 
takeactorinventory(1337,"PAPBloodTommygun",1); 
takeactorinventory(1337,"NormalPistol",1); 
takeactorinventory(1337,"PAPPistol",1); 
takeactorinventory(1337,"Colt45",1); 
takeactorinventory(1337,"PAPColt45",1); 
takeactorinventory(1337,"MP7",1); 
takeactorinventory(1337,"PAPMP7",1); 
takeactorinventory(1337,"NormalShotgun",1);  
takeactorinventory(1337,"PAPShotgun",1); 
takeactorinventory(1337,"SSG",1); 
takeactorinventory(1337,"PAPSSG",1); 
takeactorinventory(1337,"Dukeshotgun",1); 
takeactorinventory(1337,"PAPDukeshotgun",1); 
takeactorinventory(1337,"NormalChaingun",1); 
takeactorinventory(1337,"PAPChaingun",1); 
takeactorinventory(1337,"M16",1); 
takeactorinventory(1337,"PAPM16",1); 
takeactorinventory(1337,"MP5",1); 
takeactorinventory(1337,"PAPMP5",1); 
takeactorinventory(1337,"AUG",1); 
takeactorinventory(1337,"PAPAUG",1); 
takeactorinventory(1337,"SpellBinder",1); 
takeactorinventory(1337,"PAPSpellBinder",1); 
takeactorinventory(1337,"Uzi",1);
takeactorinventory(1337,"PAPUzi",1); 
takeactorinventory(1337,"Dualuzis",1); 
takeactorinventory(1337,"PAPDualuzis",1); 
takeactorinventory(1337,"MP40",1); 
takeactorinventory(1337,"PAPMP40",1); 
takeactorinventory(1337,"M1",1); 
takeactorinventory(1337,"PAPM1",1); 
takeactorinventory(1337,"FAMAS",1); 
takeactorinventory(1337,"PAPFAMAS",1); 
takeactorinventory(1337,"UAC_machinegun",1);  
takeactorinventory(1337,"PAPUAC_machinegun",1); 
takeactorinventory(1337,"Rifle",1); 
takeactorinventory(1337,"PAPRifle",1); 
takeactorinventory(1337,"AK47",1); 
takeactorinventory(1337,"PAPAK47",1); 
takeactorinventory(1337,"Thomson",1); 
takeactorinventory(1337,"PAPThomson",1); 
takeactorinventory(1337,"Quadshotgun",1); 
takeactorinventory(1337,"PAPQuadshotgun",1); 
takeactorinventory(1337,"PlasmaGun",1); 
takeactorinventory(1337,"PAPPlasmaGun",1); 
takeactorinventory(1337,"PlasmaBeam",1); 
takeactorinventory(1337,"PAPPlasmaBeam",1); 
takeactorinventory(1337,"BFG_9000",1); 
takeactorinventory(1337,"PAPBFG_9000",1); 
takeactorinventory(1337,"STBFG10K",1); 
takeactorinventory(1337,"PAPSTBFG10K",1); 
takeactorinventory(1337,"AA12",1); 
takeactorinventory(1337,"PAPAA12",1); 
takeactorinventory(1337,"ClaymoreMine",1); 
takeactorinventory(1337,"BAR",1); 
takeactorinventory(1337,"PAPBAR",1);
takeactorinventory(1337,"Model1887",1); 
takeactorinventory(1337,"Model115",1); 
takeactorinventory(1337,"PumpActionShotgun",1);  
takeactorinventory(1337,"PAPPumpActionShotgun",1); 
takeactorinventory(1337,"Revolver",1);
takeactorinventory(1337,"PAPRevolver",1);
takeactorinventory(1337,"Scar-H",1);
takeactorinventory(1337,"PAPScar-H",1);
takeactorinventory(1337,"STG-44",1);
takeactorinventory(1337,"Spatz-447",1);
takeactorinventory(1337,"Raygunmark2",1);
takeactorinventory(1337,"PAPRaygunmark2",1);
}

function void Removeweaponsp2(void)
{
takeactorinventory(1338,"Doom3shotgun",1); 
takeactorinventory(1338,"PAPDoom3shotgun",1); 
takeactorinventory(1338,"Scar-H",1);
takeactorinventory(1338,"PAPScar-H",1);
takeactorinventory(1338,"PPSH-41",1); 
takeactorinventory(1338,"PAPPPSH-41",1);
takeactorinventory(1338,"Hal's_Smartgun",1); 
takeactorinventory(1338,"Smartgun",1); ; 
takeactorinventory(1338,"RPG",1); 
takeactorinventory(1338,"PAPRPG",1); 
takeactorinventory(1338,"Revolver",1);
takeactorinventory(1338,"PAPRevolver",1);
takeactorinventory(1338,"Chainsaw2",1); 
takeactorinventory(1338,"DoubleBladedChainsaw",1); 
takeactorinventory(1338,"Raygun",1); 
takeactorinventory(1338,"PAPRaygun",1); 
takeactorinventory(1338,"BloodTommygun",1); 
takeactorinventory(1338,"PAPBloodTommygun",1); 
takeactorinventory(1338,"NormalPistol",1); 
takeactorinventory(1338,"PAPPistol",1); 
takeactorinventory(1338,"Colt45",1); 
takeactorinventory(1338,"PAPColt45",1); 
takeactorinventory(1338,"MP7",1); 
takeactorinventory(1338,"PAPMP7",1); 
takeactorinventory(1338,"NormalShotgun",1);  
takeactorinventory(1338,"PAPShotgun",1); 
takeactorinventory(1338,"SSG",1); 
takeactorinventory(1338,"Flaregun",1);  
takeactorinventory(1338,"PAPFlaregun",1); 
takeactorinventory(1338,"PAPSSG",1); 
takeactorinventory(1338,"Dukeshotgun",1); 
takeactorinventory(1338,"PAPDukeshotgun",1); 
takeactorinventory(1338,"NormalChaingun",1); 
takeactorinventory(1338,"PAPChaingun",1); 
takeactorinventory(1338,"M16",1); 
takeactorinventory(1338,"PAPM16",1); 
takeactorinventory(1338,"MP5",1); 
takeactorinventory(1338,"PAPMP5",1); 
takeactorinventory(1338,"AUG",1); 
takeactorinventory(1338,"PAPAUG",1); 
takeactorinventory(1338,"SpellBinder",1); 
takeactorinventory(1338,"PAPSpellBinder",1); 
takeactorinventory(1338,"Uzi",1);
takeactorinventory(1338,"PAPUzi",1); 
takeactorinventory(1338,"Dualuzis",1); 
takeactorinventory(1338,"PAPDualuzis",1); 
takeactorinventory(1338,"MP40",1); 
takeactorinventory(1338,"PAPMP40",1); 
takeactorinventory(1338,"M1",1); 
takeactorinventory(1338,"PAPM1",1); 
takeactorinventory(1338,"FAMAS",1); 
takeactorinventory(1338,"PAPFAMAS",1); 
takeactorinventory(1338,"UAC_machinegun",1);  
takeactorinventory(1338,"PAPUAC_machinegun",1); 
takeactorinventory(1338,"Rifle",1); 
takeactorinventory(1338,"PAPRifle",1); 
takeactorinventory(1338,"AK47",1); 
takeactorinventory(1338,"PAPAK47",1); 
takeactorinventory(1338,"Thomson",1); 
takeactorinventory(1338,"PAPThomson",1); 
takeactorinventory(1338,"Quadshotgun",1); 
takeactorinventory(1338,"PAPQuadshotgun",1); 
takeactorinventory(1338,"PlasmaGun",1); 
takeactorinventory(1338,"PAPPlasmaGun",1); 
takeactorinventory(1338,"PlasmaBeam",1); 
takeactorinventory(1338,"PAPPlasmaBeam",1); 
takeactorinventory(1338,"BFG_9000",1); 
takeactorinventory(1338,"PAPBFG_9000",1); 
takeactorinventory(1338,"STBFG10K",1); 
takeactorinventory(1338,"PAPSTBFG10K",1); 
takeactorinventory(1338,"AA12",1); 
takeactorinventory(1338,"PAPAA12",1); 
takeactorinventory(1338,"ClaymoreMine",1); 
takeactorinventory(1338,"BAR",1); 
takeactorinventory(1338,"PAPBAR",1);
takeactorinventory(1338,"Model1887",1); 
takeactorinventory(1338,"Model115",1); 
takeactorinventory(1338,"PumpActionShotgun",1);  
takeactorinventory(1338,"PAPPumpActionShotgun",1); 
takeactorinventory(1338,"STG-44",1);
takeactorinventory(1338,"Spatz-447",1);
takeactorinventory(1338,"Raygunmark2",1);
takeactorinventory(1338,"PAPRaygunmark2",1);
}
//Seconds///////////////////
script 854 (void)
{
  while(timeon > 0)
  {
   seconds = seconds + 1;
   //giveactorinventory(1337,"Seconds",1); 
   //giveactorinventory(1338,"Seconds",1); 
   if(seconds==60)
   {
    minutes = minutes + 1;
    seconds = 0;
   //takeactorinventory(1337,"Seconds",60); 
   //takeactorinventory(1338,"Seconds",60); 
   //giveactorinventory(1337,"Minutes",1); 
   //giveactorinventory(1338,"Minutes",1); 
   }
  delay(35);
  }
}

script 405 OPEN
{
//Easy 0 Normal 1 Zombies Mode 2 Brimstone 3 Timed Gameplay 4 Hell start 5
 if(gameskill()==0)
 {
   spawntime=135;
 }
 else if(gameskill()==1)
 {
   spawntime=100;
 }
 else if(gameskill()==2)
 {
   spawntime=100;
 }
 else if(gameskill()==3)
 {
   spawntime=55;
 }
 else if(gameskill()==4)
 {
   spawntime=85;
 }
 else if(gameskill()==5)
 {
   spawntime=85;
 }
}

script 675 (void)
{
  if(playernumber()==0)
  {
   if(P1SU==0)
   {
	if(CheckInventory("Aiming") == 1)
	{
		SetActorProperty(1337,APROP_Speed,0.35);
	}
	else if(CheckInventory("Aiming") == 0)
	{
		SetActorProperty(1337,APROP_Speed,1.1);
	}
   }
   else if(P1SU==1)
   {
	if(CheckInventory("Aiming") == 1)
	{
		SetActorProperty(1337,APROP_Speed,0.5);
	}
	else if(CheckInventory("Aiming") == 0)
	{
		SetActorProperty(1337,APROP_Speed,1.5);
	}
   }
  }
  else if(playernumber()==1)
  {
   if(P2SU==0)
   {
	if(CheckInventory("Aiming") == 1)
	{
		SetActorProperty(1338,APROP_Speed,0.35);
	}
	else if(CheckInventory("Aiming") == 0)
	{
		SetActorProperty(1338,APROP_Speed,1.1);
	}
   }
   else if(P2SU==1)
   {
	if(CheckInventory("Aiming") == 1)
	{
		SetActorProperty(1338,APROP_Speed,0.5);
	}
	else if(CheckInventory("Aiming") == 0)
	{
		SetActorProperty(1338,APROP_Speed,1.5);
	}
   }
  }
}

//Pack A Punch////////////////////////////////////////////

Script 210 (void)
{
  if(power==1 && bonfiresale<1)
  {
  HudMessage(s:"Press \cfUSE \c-to Upgrade A Gun \cf[Cost:5000]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
  else if(power==1 && bonfiresale>0)
  {
  HudMessage(s:"Press \cfUSE \c-to Upgrade A Gun \cf[Cost:1000]";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
  else if(power==0)
  {
  HudMessage(s:"Turn on the power first!";HUDMSG_PLAIN, 99, CR_White, 0.50, 0.50, 2.0);
  }
}


Script 211 (void)
{
 if(bonfiresale>0){moneyneeded = 1000;}else if(bonfiresale<1){moneyneeded = 5000;}
 if(activatorTID()==1337 && power==1 && checkactorinventory(1337,"money")>= moneyneeded){Acs_execute(920,0,0,0,0);delay(15); Acs_execute(212,0,0,0,0);}
 else if(activatorTID()==1338 && power==1 && checkactorinventory(1338,"money")>= moneyneeded){Acs_execute(921,0,0,0,0);delay(15); Acs_execute(213,0,0,0,0);}
}

script 920 (void)
{
if(checkweapon("UAC_Machinegun")){normalweaponp1 = "UAC_Machinegun";papweaponp1 = "PAPUAC_Machinegun";abletopapp1 = 1;}
else if(checkweapon("PPSH-41")){normalweaponp1 = "PPSH-41";papweaponp1 = "PAPPPSH-41";abletopapp1 = 1;}
else if(checkweapon("SCAR-H")){normalweaponp1 = "SCAR-H";papweaponp1 = "PAPSCAR-H";abletopapp1 = 1;}
else if(checkweapon("RPG")){normalweaponp1 = "RPG";papweaponp1 = "PAPRPG";abletopapp1 = 1;}
else if(checkweapon("AA12")){normalweaponp1 = "AA12";papweaponp1 = "PAPAA12";abletopapp1 = 1;}
else if(checkweapon("Pumpactionshotgun")){normalweaponp1 = "Pumpactionshotgun";papweaponp1 = "PAPPumpactionshotgun";abletopapp1 = 1;}
else if(checkweapon("Spellbinder")){normalweaponp1 = "Spellbinder";papweaponp1 = "PAPSpellbinder";abletopapp1 = 1;}
else if(checkweapon("STBFG10k")){normalweaponp1 = "STBFG10k";papweaponp1 = "PAPSTBFG10k";abletopapp1 = 1;}
else if(checkweapon("Bloodtommygun")){normalweaponp1 = "Bloodtommygun";papweaponp1 = "PAPBloodtommygun";abletopapp1 = 1;}
else if(checkweapon("MP7")){normalweaponp1 = "MP7";papweaponp1 = "PAPMP7";abletopapp1 = 1;}
else if(checkweapon("model1887")){normalweaponp1 = "model1887";papweaponp1 = "Model115";abletopapp1 = 1;}
else if(checkweapon("BAR")){normalweaponp1 = "BAR";papweaponp1 = "PAPBAR";abletopapp1 = 1;}
Else if(checkweapon("BFG_9000")){normalweaponp1 = "BFG_9000";papweaponp1 = "PAPBFG_9000";abletopapp1 = 1;}
else if(checkweapon("QuadShotgun")){normalweaponp1 = "QuadShotgun";papweaponp1 = "PAPQuadShotgun";abletopapp1 = 1;}
else if(checkweapon("normalPistol")){normalweaponp1 = "normalPistol";papweaponp1 = "PAPPistol";abletopapp1 = 1;}
else if(checkweapon("normalshotgun")){normalweaponp1 = "normalshotgun";papweaponp1 = "PAPshotgun";abletopapp1 = 1;}
else if(checkweapon("SSG")){normalweaponp1 = "SSG";papweaponp1 = "PAPSSG";abletopapp1 = 1;}
else if(checkweapon("ak47")){normalweaponp1 = "ak47";papweaponp1 = "PAPak47";abletopapp1 = 1;}
else if(checkweapon("Mp40")){normalweaponp1 = "Mp40";papweaponp1 = "PAPMp40";abletopapp1 = 1;}
else if(checkweapon("Mp5")){normalweaponp1 = "Mp5";papweaponp1 = "PAPMp5";abletopapp1 = 1;}
else if(checkweapon("Thomson")){normalweaponp1 = "Thomson";papweaponp1 = "PAPThomson";abletopapp1 = 1;}
else if(checkweapon("AUG")){normalweaponp1 = "AUG";papweaponp1 = "PAPAUG";abletopapp1 = 1;}
else if(checkweapon("Famas")){normalweaponp1 = "Famas";papweaponp1 = "PAPFamas";abletopapp1 = 1;}
else if(checkweapon("DualUzis")){normalweaponp1 = "DualUzis";papweaponp1 = "PAPDualUzis";abletopapp1 = 1;}
else if(checkweapon("Uzi")){normalweaponp1 = "Uzi";papweaponp1 = "PAPUzi";abletopapp1 = 1;}
Else if(checkweapon("normalChaingun")){normalweaponp1 = "normalChaingun";papweaponp1 = "PAPChaingun";abletopapp1 = 1;}
Else if(checkweapon("Colt45")){normalweaponp1 = "Colt45";papweaponp1 = "PAPColt45";abletopapp1 = 1;}
Else if(checkweapon("Chainsaw2")){normalweaponp1 = "Chainsaw2";papweaponp1 = "DoubleBladedChainsaw";abletopapp1 = 1;}
Else if(checkweapon("Dukeshotgun")){normalweaponp1 = "Dukeshotgun";papweaponp1 = "PAPDukeshotgun";abletopapp1 = 1;}
Else if(checkweapon("M1")){normalweaponp1 = "M1";papweaponp1 = "PAPM1";abletopapp1 = 1;}
Else if(checkweapon("M16")){normalweaponp1 = "M16";papweaponp1 = "PAPM16";abletopapp1 = 1;}
Else if(checkweapon("PlasmaBeam")){normalweaponp1 = "PlasmaBeam";papweaponp1 = "PAPPlasmaBeam";abletopapp1 = 1;}
Else if(checkweapon("PlasmaGun")){normalweaponp1 = "PlasmaGun";papweaponp1 = "PAPPlasmaGun";abletopapp1 = 1;}
Else if(checkweapon("RayGun")){normalweaponp1 = "RayGun";papweaponp1 = "PAPRayGun";abletopapp1 = 1;}
Else if(checkweapon("Revolver")){normalweaponp1 = "Revolver";papweaponp1 = "PAPRevolver";abletopapp1 = 1;}
Else if(checkweapon("Rifle")){normalweaponp1 = "Rifle";papweaponp1 = "PAPRifle";abletopapp1 = 1;}
Else if(checkweapon("smartgun")){normalweaponp1 = "smartgun";papweaponp1 = "Hal's_Smartgun";abletopapp1 = 1;}
Else if(checkweapon("flaregun")){normalweaponp1 = "flaregun";papweaponp1 = "PAPflaregun";abletopapp1 = 1;}
Else if(checkweapon("doom3shotgun")){normalweaponp1 = "doom3shotgun";papweaponp1 = "PAPdoom3shotgun";abletopapp1 = 1;}
Else if(checkweapon("STG-44")){normalweaponp1 = "STG-44";papweaponp1 = "Spatz-447";abletopapp1 = 1;}
Else if(checkweapon("PulseMachinegun")){normalweaponp1 = "PulseMachinegun";papweaponp1 = "PAPPulseMachinegun";abletopapp1 = 1;}
Else if(checkweapon("Raygunmark2")){normalweaponp1 = "Raygunmark2";papweaponp1 = "PAPRaygunmark2";abletopapp1 = 1;}

}
script 921 (void)
{
if(checkweapon("UAC_Machinegun")){normalweaponp2 = "UAC_Machinegun";papweaponp2 = "PAPUAC_Machinegun";abletopapp2 = 1;}
else if(checkweapon("PPSH-41")){normalweaponp2 = "PPSH-41";papweaponp2 = "PAPPPSH-41";abletopapp2 = 1;}
else if(checkweapon("SCAR-H")){normalweaponp2 = "SCAR-H";papweaponp2 = "PAPSCAR-H";abletopapp2 = 1;}
else if(checkweapon("RPG")){normalweaponp2 = "RPG";papweaponp2 = "PAPRPG";abletopapp2 = 1;}
else if(checkweapon("AA12")){normalweaponp2 = "AA12";papweaponp2 = "PAPAA12";abletopapp2 = 1;}
else if(checkweapon("Pumpactionshotgun")){normalweaponp2 = "Pumpactionshotgun";papweaponp2 = "PAPPumpactionshotgun";abletopapp2 = 1;}
else if(checkweapon("Spellbinder")){normalweaponp2 = "Spellbinder";papweaponp2 = "PAPSpellbinder";abletopapp2 = 1;}
else if(checkweapon("STBFG10k")){normalweaponp2 = "STBFG10k";papweaponp2 = "PAPSTBFG10k";abletopapp2 = 1;}
else if(checkweapon("Bloodtommygun")){normalweaponp2 = "Bloodtommygun";papweaponp2 = "PAPBloodtommygun";abletopapp2 = 1;}
else if(checkweapon("MP7")){normalweaponp2 = "MP7";papweaponp2 = "PAPMP7";abletopapp2 = 1;}
else if(checkweapon("model1887")){normalweaponp2 = "model1887";papweaponp2 = "Model115";abletopapp2 = 1;}
else if(checkweapon("BAR")){normalweaponp2 = "BAR";papweaponp2 = "PAPBAR";abletopapp2 = 1;}
Else if(checkweapon("BFG_9000")){normalweaponp2 = "BFG_9000";papweaponp2 = "PAPBFG_9000";abletopapp2 = 1;}
else if(checkweapon("QuadShotgun")){normalweaponp2 = "QuadShotgun";papweaponp2 = "PAPQuadShotgun";abletopapp2 = 1;}
else if(checkweapon("normalPistol")){normalweaponp2 = "normalPistol";papweaponp2 = "PAPPistol";abletopapp2 = 1;}
else if(checkweapon("normalshotgun")){normalweaponp2 = "normalshotgun";papweaponp2 = "PAPshotgun";abletopapp2 = 1;}
else if(checkweapon("SSG")){normalweaponp2 = "SSG";papweaponp2 = "PAPSSG";abletopapp2 = 1;}
else if(checkweapon("ak47")){normalweaponp2 = "ak47";papweaponp2 = "PAPak47";abletopapp2 = 1;}
else if(checkweapon("Mp40")){normalweaponp2 = "Mp40";papweaponp2 = "PAPMp40";abletopapp2 = 1;}
else if(checkweapon("Mp5")){normalweaponp2 = "Mp5";papweaponp2 = "PAPMp5";abletopapp2 = 1;}
else if(checkweapon("Thomson")){normalweaponp2 = "Thomson";papweaponp2 = "PAPThomson";abletopapp2 = 1;}
else if(checkweapon("AUG")){normalweaponp2 = "AUG";papweaponp2 = "PAPAUG";abletopapp2 = 1;}
else if(checkweapon("Famas")){normalweaponp2 = "Famas";papweaponp2 = "PAPFamas";}
else if(checkweapon("DualUzis")){normalweaponp2 = "DualUzis";papweaponp2 = "PAPDualUzis";}
else if(checkweapon("Uzi")){normalweaponp2 = "Uzi";papweaponp2 = "PAPUzi";abletopapp2 = 1;}
Else if(checkweapon("normalChaingun")){normalweaponp2 = "normalChaingun";papweaponp2 = "PAPChaingun";abletopapp2 = 1;}
Else if(checkweapon("Colt45")){normalweaponp2 = "Colt45";papweaponp2 = "PAPColt45";abletopapp2 = 1;}
Else if(checkweapon("Chainsaw2")){normalweaponp2 = "Chainsaw2";papweaponp2 = "DoubleBladedChainsaw";abletopapp2 = 1;}
Else if(checkweapon("Dukeshotgun")){normalweaponp2 = "Dukeshotgun";papweaponp2 = "PAPDukeshotgun";abletopapp2 = 1;}
Else if(checkweapon("M1")){normalweaponp2 = "M1";papweaponp2 = "PAPM1";abletopapp2 = 1;}
Else if(checkweapon("M16")){normalweaponp2 = "M16";papweaponp2 = "PAPM16";abletopapp2 = 1;}
Else if(checkweapon("PlasmaBeam")){normalweaponp2 = "PlasmaBeam";papweaponp2 = "PAPPlasmaBeam";abletopapp2 = 1;}
Else if(checkweapon("PlasmaGun")){normalweaponp2 = "PlasmaGun";papweaponp2 = "PAPPlasmaGun";abletopapp2 = 1;}
Else if(checkweapon("RayGun")){normalweaponp2 = "RayGun";papweaponp2 = "PAPRayGun";abletopapp2 = 1;}
Else if(checkweapon("Revolver")){normalweaponp2 = "Revolver";papweaponp2 = "PAPRevolver";abletopapp2 = 1;}
Else if(checkweapon("Rifle")){normalweaponp2 = "Rifle";papweaponp2 = "PAPRifle";abletopapp2 = 1;}
Else if(checkweapon("smartgun")){normalweaponp2 = "smartgun";papweaponp2 = "Hal's_Smartgun";abletopapp2 = 1;}
Else if(checkweapon("flaregun")){normalweaponp2 = "flaregun";papweaponp2 = "PAPflaregun";abletopapp2 = 1;}
Else if(checkweapon("doom3shotgun")){normalweaponp2 = "doom3shotgun";papweaponp2 = "PAPdoom3shotgun";abletopapp2 = 1;}
Else if(checkweapon("STG-44")){normalweaponp2 = "STG-44";papweaponp2 = "Spatz-447";abletopapp2 = 1;}
Else if(checkweapon("PulseMachinegun")){normalweaponp2 = "PulseMachinegun";papweaponp2 = "PAPPulseMachinegun";abletopapp2 = 1;}
Else if(checkweapon("Raygunmark2")){normalweaponp2 = "Raygunmark2";papweaponp2 = "PAPRaygunmark2";abletopapp2 = 1;}
}


 //Player 1/////////////////////////////////////////////////
Script 212 (void)
{
 if(abletopapp1==1)
 {
  takeactorinventory(1337,"money",moneyneeded);
  giveinventory(papweaponp1,1);
  takeinventory(normalweaponp1,1);
  setweapon(papweaponp1);
 }
 abletopapp1 = 0;
}
//Player 2/////////////////////////////////////////////////
Script 213 (void)
{
 if(abletopapp2==1)
 {
  takeactorinventory(1338,"money",moneyneeded);
  giveinventory(papweaponp2,1);
  setweapon(papweaponp2);
  takeinventory(normalweaponp2,1);
 }
 abletopapp2 = 0;
}
//End Perks////////////////////////////////////
//Kill for Money/////////////////////////////////////////////////
script 4 (void)
{

            //player 1
            if(ActivatorTID()==1337)
            {
            P1kills = P1kills + 1;
            enemycount = enemycount - 1;
			if(P1voicetalking==0){P1kill = 1;}
            }
            //Player 2
            else if(ActivatorTID()==1338)
            {
            P2kills = P2kills + 1;
            enemycount = enemycount - 1;
            }
            else
            enemycount = enemycount - 1;
} 

//Menu?/////////////////////////////////////////////////////////////////
//Script 666 AND 667 oh Shit!///////////////////////////////////////////
//Player1 = 667,668 Player2 = 669,670
script 666 (void)
{
 if(ActivatorTID()==1337)
 {
  acs_execute(667,0,0,0,0);
 }
 else if(ActivatorTID()==1338)
 {
  acs_execute(669,0,0,0,0);
 }
}
script 667 (void)
{
       if(menuactiveP1==false && gameover==0)
       {
       menuactiveP1 = true;
	   acs_execute(668,0,0,0,0);
       }
       else if(menuactiveP1==true)
       {
       menuactiveP1 = false;
	   hudmessage(s:""; HUDMSG_PLAIN, 50, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 51, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 52, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 53, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 54, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 55, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 56, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 57, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 58, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 59, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 60, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 61, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 62, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 63, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 64, CR_red, 0.90, 0.25, 1);
       }
}

script 668 (void)
{
  while(menuactiveP1==true && gameover==0)
  {
     setfont("smallfont");
      menupointsp1 = checkactorinventory(1337,"Money");
      menupointsp2 = checkactorinventory(1338,"Money");
      HudMessage(s:"kills"; HUDMSG_PLAIN, 50, CR_red, 0.90, 0.30, 1);
      HudMessage(s:"score"; HUDMSG_PLAIN, 51, CR_red, 0.70, 0.30, 1);
      HudMessage(s:"Demons Alive"; HUDMSG_PLAIN, 52, CR_red, 0.10, 0.2, 1);
      HudMessage(d:enemycount; HUDMSG_PLAIN, 59, CR_white, 0.10, 0.25, 1);    
	  if(gameskill()!=4)
	  {
      HudMessage(s:"Demons To spawn"; HUDMSG_PLAIN, 60, CR_red, 0.50, 0.2, 1);
      HudMessage(d:enemiesallowed; HUDMSG_PLAIN, 61, CR_white, 0.50, 0.25, 1); 
      HudMessage(s:"Wave: ",d:wavenumber; HUDMSG_PLAIN, 64, CR_red, 0.50, 0.15, 1); 
	  } 
	  else if(gameskill()==4)
	  {
      HudMessage(s:""; HUDMSG_PLAIN, 60, CR_red, 0.50, 0.2, 1);
	  HudMessage(d:minutes,s:":",d:seconds; HUDMSG_PLAIN, 64, CR_red, 0.50, 0.15, 1); 
	  }
      HudMessage(s:"Demons Spawned"; HUDMSG_PLAIN, 62, CR_red, 0.70, 0.2, 1);
      HudMessage(d:spawnedmonsters; HUDMSG_PLAIN, 63, CR_white, 0.70, 0.25, 1);  
	  HudMessage( n:1; HUDMSG_PLAIN, 53, CR_white, 0.10, 0.4, 1);
      HudMessage(d: menupointsp1; HUDMSG_PLAIN, 54, CR_White, 0.70, 0.4, 1);
      HudMessage(d: p1kills; HUDMSG_PLAIN, 55, CR_White, 0.90, 0.4, 1);
	  if(PlayerCount()>1) 
	  {
      HudMessage(n:2; HUDMSG_PLAIN, 56, CR_yellow, 0.10, 0.5, 1);
      HudMessage(d: menupointsp2; HUDMSG_PLAIN, 57, CR_yellow, 0.70, 0.5, 1);
      HudMessage(d: p2kills; HUDMSG_PLAIN, 58, CR_yellow, 0.90, 0.5, 1);
      }
	delay(1);  
  }
}
script 669 (void)
{
       if(menuactiveP2==false && gameover==0)
       {
       menuactiveP2 = true;
	   acs_execute(670,0,0,0,0);
       }
       else if(menuactiveP2==true)
       {
       menuactiveP2 = false;
	   hudmessage(s:""; HUDMSG_PLAIN, 50, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 51, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 52, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 53, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 54, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 55, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 56, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 57, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 58, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 59, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 60, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 61, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 62, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 63, CR_red, 0.90, 0.25, 1);
	   hudmessage(s:""; HUDMSG_PLAIN, 64, CR_red, 0.90, 0.25, 1);
       }
}

script 670 (void)
{
  while(menuactiveP2==true && gameover==0)
  {
     setfont("smallfont");
      menupointsp1 = checkactorinventory(1337,"Money");
      menupointsp2 = checkactorinventory(1338,"Money");
      HudMessage(s:"kills"; HUDMSG_PLAIN, 50, CR_red, 0.90, 0.30, 1);
      HudMessage(s:"score"; HUDMSG_PLAIN, 51, CR_red, 0.70, 0.30, 1);
      HudMessage(s:"Demons Alive"; HUDMSG_PLAIN, 52, CR_red, 0.10, 0.2, 1);
      HudMessage(d:enemycount; HUDMSG_PLAIN, 59, CR_white, 0.10, 0.25, 1);  
	  if(gameskill()!=4)
	  {
      HudMessage(s:"Demons To spawn"; HUDMSG_PLAIN, 60, CR_red, 0.50, 0.2, 1);
      HudMessage(d:enemiesallowed; HUDMSG_PLAIN, 61, CR_white, 0.50, 0.25, 1); 
      HudMessage(s:"Wave: ",d:wavenumber; HUDMSG_PLAIN, 64, CR_red, 0.50, 0.15, 1); 
	  } 
	  else if(gameskill()==4)
	  {
      HudMessage(s:""; HUDMSG_PLAIN, 60, CR_red, 0.50, 0.2, 1);
	  HudMessage(d:minutes,s:":",d:seconds; HUDMSG_PLAIN, 64, CR_red, 0.50, 0.15, 1); 
	  }
      HudMessage(s:"Demons spawned"; HUDMSG_PLAIN, 62, CR_red, 0.70, 0.2, 1);
      HudMessage(d:spawnedmonsters; HUDMSG_PLAIN, 63, CR_white, 0.70, 0.25, 1);  
	  HudMessage( n:1; HUDMSG_PLAIN, 53, CR_white, 0.10, 0.4, 1);
      HudMessage(d: menupointsp1; HUDMSG_PLAIN, 54, CR_White, 0.70, 0.4, 1);
      HudMessage(d: p1kills; HUDMSG_PLAIN, 55, CR_White, 0.90, 0.4, 1);
	  if(PlayerCount()>1) 
	  {
      HudMessage(n:2; HUDMSG_PLAIN, 56, CR_yellow, 0.10, 0.5, 1);
      HudMessage(d: menupointsp2; HUDMSG_PLAIN, 57, CR_yellow, 0.70, 0.5, 1);
      HudMessage(d: p2kills; HUDMSG_PLAIN, 58, CR_yellow, 0.90, 0.5, 1);
      }
	delay(1);  
  }
}

SCRIPT 255 (void) NET
{
 if(CheckInventory("GrenadeAmmo")>0 && CheckInventory("thrownade")==0)
 {
  TakeInventory("GrenadeAmmo",1);
  GiveInventory("thrownade",1);
 }
}


SCRIPT 256 (void) NET
{
  GiveInventory("Kinfeammo",1);
}

SCRIPT 257 (void) NET
{
  GiveInventory("IsReloading",1);
}

script 995 (void) 
{
if(gameskill()==3)
{
  if(playercount()==1)
  {
  P1QR = 1;
  P1PerkBought[1]=1; P1PerkBoughtName[1]="QR"; P1QRPlace=0.01;
  acs_execute(208,0,0,0,0);
  acs_execute(410,0,0,0,0);
  GiveInventory("megasphere", 1);
  giveactorinventory(1337,"QuickRevive",1);
  }
  else if(playercount()>1)
  {
  P2QR = 1;
  P2PerkBought[1]=1; P2PerkBoughtName[1]="QR"; P2QRPlace=0.01;
  acs_execute(209,0,0,0,0);
  acs_execute(410,0,0,0,0);
  giveactorinventory(1337,"QuickRevive",1);
  P1QR = 1;
  P1PerkBought[1]=1; P1PerkBoughtName[1]="QR"; P1QRPlace=0.01;
  acs_execute(208,0,0,0,0);
  acs_execute(413,0,0,0,0);
  giveactorinventory(1338,"QuickRevive",1);
  GiveInventory("megasphere", 1);
  }
}
else if(gameskill()==5)
{
 wavenumber = 25;
  if(playercount()==1)
  {
  P1QR = 1;
  P1PerkBought[1]=1; P1PerkBoughtName[1]="QR"; P1QRPlace=0.01;
  acs_execute(208,0,0,0,0);
  acs_execute(410,0,0,0,0);
  GiveInventory("megasphere", 1);
  giveactorinventory(1337,"QuickRevive",1);
  giveactorinventory(1337,"money",9500);
  giveactorinventory(1337,"points",9500);
  }
  else if(playercount()>1)
  {
  P2QR = 1;
  P2PerkBought[1]=1; P2PerkBoughtName[1]="QR"; P2QRPlace=0.01;
  acs_execute(209,0,0,0,0);
  acs_execute(410,0,0,0,0);
  giveactorinventory(1337,"QuickRevive",1);
  giveactorinventory(1337,"money",9500);
  giveactorinventory(1337,"points",9500);
  giveactorinventory(1337,"megasphere",1);
  P1QR = 1;
  P1PerkBought[1]=1; P1PerkBoughtName[1]="QR"; P1QRPlace=0.01;
  acs_execute(208,0,0,0,0);
  acs_execute(413,0,0,0,0);
  giveactorinventory(1338,"QuickRevive",1);
  giveactorinventory(1338,"money",9500);
  giveactorinventory(1338,"points",9500);
  giveactorinventory(1338,"megasphere",1);
  }
}
}
//Power UPS!//////////////////////////////////////////////
//Insta-kill//////////////////////////////////////////////
Script 250 (void)
{
   insta = 30;
   acs_execute(251,0,0,0,0);
   If(Newvoice==0)
   {
   AmbientSound("power/Instakill",127);
   }
   else If(Newvoice==1)
   {
   AmbientSound("NewVoice/Instakill",127);
   }
   else If(Newvoice==2)
   {
   AmbientSound("SamVoice/Instakill",127);
   }
   while(insta>0)
   {
   delay(1);    
   SetActorProperty(666, APROP_Health, 1);
   }
acs_executeAlways(750,0,1,0,0);
}

Script 251 (void)
{
   while(insta>0)
   {   
    insta = insta - 1;
   delay(35); 
   }
}
//UnlimitedAmmo//////////////////////////////////////////////
Script 252 (void)
{
   UAmmo = 30;
   acs_execute(253,0,0,0,0);
   If(Newvoice==0)
   {
   AmbientSound("power/Uammo",127);
   }
   else If(Newvoice==1)
   {
   AmbientSound("NewVoice/Unlimtedammo",127);
   }
   else If(Newvoice==2)
   {
   AmbientSound("SamVoice/Unlimtedammo",127);
   }
   while(UAmmo>0)
   {
   ammo();
   delay(1);   
   }
}

Script 253 (void)
{
   while(UAmmo>0)
   {   
    UAmmo = UAmmo - 1;
    delay(35); 
   }
}
//Doublepoints///////////////////////////////////////////////
script 258 (void)
{
 doublepoints = 30;
   If(Newvoice==0)
   {
 AmbientSound("power/Doublepoints",127);
 }
   else If(Newvoice==1)
   {
   AmbientSound("NewVoice/DoublePoints",127);
   }
   else If(Newvoice==2)
   {
   AmbientSound("SamVoice/DoublePoints",127);
   }
 while(doublepoints>0)
 {
 doublepoints = doublepoints - 1;
 delay(35);
 }
}
//Bonfiresale///////////////////////////////////////////////
script 259 (void)
{
 Bonfiresale = 30;
   If(Newvoice==0)
   {
 AmbientSound("power/Bonfiresale",127);
 }
   else If(Newvoice==1)
   {
   AmbientSound("NewVoice/BonFireSale",127);
   }
   else If(Newvoice==2)
   {
   AmbientSound("SamVoice/BonFireSale",127);
   }
 while(Bonfiresale>0)
 {
 Bonfiresale = Bonfiresale - 1;
 delay(35);
 }
}
//MaxAmmo//////////////////////////////////////////////
Script 254 (void)
{
   If(Newvoice==0)
   {
   AmbientSound("power/Maxammo",127);
   }
   else If(Newvoice==1)
   {
   AmbientSound("NewVoice/Maxammo",127);
   }
   else If(Newvoice==2)
   {
   AmbientSound("SamVoice/Maxammo",127);
   }
   ammo();
   }

Script 988 (Void)
{
     while(GetActorProperty(1337, APROP_Health)>0)
     { 
            if(insta>0)
            {
            setfont("IKIC");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 92+playernumber(), CR_White, 0.35, 0.99, 1.0);
            } 
            if(Uammo>0)
            {
            setfont("UAIC");
            HudMessage(s:"a";
            HUDMSG_PLAIN, 93+playernumber(), CR_White, 0.45, 0.99, 1.0);
            }
            if(doublepoints>0)
            {
            setfont("DPIC");
            HudMessage(s:"a";
            HUDMSG_PLAIN, 94+playernumber(), CR_White, 0.55, 0.99, 1.0);
            }  
            if(bonfiresale>0)
            {
            setfont("BFIC");
            HudMessage(s:"a";
            HUDMSG_PLAIN, 95+playernumber(), CR_White, 0.65, 0.99, 1.0);
            }  
			delay(1);
		}
	}
	
Script 989 (Void)
{
     while(GetActorProperty(1338, APROP_Health)>0)
     {
            if(insta>0)
            {
            setfont("IKIC");
            HudMessage(s:"A";
            HUDMSG_PLAIN, 92+playernumber(), CR_White, 0.35, 0.99, 1.0);
            } 
            if(Uammo>0)
            {
            setfont("UAIC");
            HudMessage(s:"a";
            HUDMSG_PLAIN, 93+playernumber(), CR_White, 0.45, 0.99, 1.0);
            }
            if(doublepoints>0)
            {
            setfont("DPIC");
            HudMessage(s:"a";
            HUDMSG_PLAIN, 94+playernumber(), CR_White, 0.55, 0.99, 1.0);
            }  
            if(bonfiresale>0)
            {
            setfont("BFIC");
            HudMessage(s:"a";
            HUDMSG_PLAIN, 95+playernumber(), CR_White, 0.65, 0.99, 1.0);
            }  
			delay(1);
		}
}

SCRIPT 402 (int amount)
{
 if(doublepoints>0){amount = amount*2;}
 if(amount>-1) {SetActivatorToTarget(0);}
 if(amount>-1) {GiveInventory("money",amount); GiveInventory("points",amount);}
 SetFont("CONFONT");
 if(amount>-1) {HudMessage(s:"+",d:amount;HUDMSG_FADEOUT,0,CR_YELLOW,1.9+(random(-5,5)*0.01),0.8+(random(-5,5)*0.01),0.1,1.0);}
}

SCRIPT 403 (int amount2)
{
 if(doublepoints>0){amount2 = amount2*2;}
 if(amount2>-1) {GiveactorInventory(1337,"money",amount2); GiveactorInventory(1337,"points",amount2);GiveactorInventory(1338,"money",amount2); GiveactorInventory(1338,"points",amount2);}
 SetFont("CONFONT");
 if(amount2>-1) {HudMessage(s:"+",d:amount2;HUDMSG_FADEOUT,1,CR_YELLOW,1.9+(random(-5,5)*0.01),0.8+(random(-5,5)*0.01),0.1,1.0);}
}

script 404 (int amount3)
{
 wavenumber = wavenumber + amount3;
}



Script 400 (void)
{
  int TemporaryVariableC;
  TemporaryVariableC=random(1,50);
  if(TemporaryVariableC==1) {Spawn("MaxAmmo",GetActorX(0),GetActorY(0),GetActorZ(0),0,0);}
  else if(TemporaryVariableC==2) {Spawn("InstaKill",GetActorX(0),GetActorY(0),GetActorZ(0),0,0);}
  else if(TemporaryVariableC==3) {Spawn("UnlimitedAmmo",GetACtorX(0),GetActorY(0),GetActorZ(0),0,0);}
  else if(TemporaryVariableC==4) {Spawn("doublepoints",GetACtorX(0),GetActorY(0),GetActorZ(0),0,0);}
 }
 

function void Ammo(void)
{
giveactorinventory(1337,"DukeAmmo",999);
giveactorinventory(1337,"PAPDukeAmmo",999);
giveactorinventory(1337,"Flares",999);
giveactorinventory(1337,"PAPFlares",999);
giveactorinventory(1337,"Colt45Ammo",999);
giveactorinventory(1337,"PAPColt45Ammo",999);
giveactorinventory(1337,"AK47Ammo",999);
giveactorinventory(1337,"PAPAK47Ammo",999);
giveactorinventory(1337,"RPGClip",999);
giveactorinventory(1337,"RPGAmmo",999);
giveactorinventory(1337,"PPSHClip",999);
giveactorinventory(1337,"PPSHAmmo",999);
giveactorinventory(1337,"PAPRPGClip",999);
giveactorinventory(1337,"PAPRPGAmmo",999);
giveactorinventory(1337,"PAPPPSHClip",999);
giveactorinventory(1337,"PAPPPSHAmmo",999);
   giveactorinventory(1337,"PAPQUADclip",999);
   giveactorinventory(1337,"quadclip",999);
   giveactorinventory(1337,"PAPPistolclip",999);
   giveactorinventory(1337,"PAPshotgunclip",999);
   giveactorinventory(1337,"PAPSSGclip",999); 
   giveactorinventory(1337,"PAPchaingunclip",999);    
   giveactorinventory(1337,"chaingunclip",999);   
   giveactorinventory(1337,"ssgclip",999);
    giveactorinventory(1337,"pistolclip",999);
    giveactorinventory(1337,"pistolammo",999);
    giveactorinventory(1337,"shotgunclip",999);
    giveactorinventory(1337,"uziclip",999);
    giveactorinventory(1337,"m1clip",999);
    giveactorinventory(1337,"papm1clip",999);
    giveactorinventory(1337,"rifleclip",999);
    giveactorinventory(1337,"m16clip",999);
    giveactorinventory(1337,"mp5clip",999);
    giveactorinventory(1337,"mp40clip",999);
    giveactorinventory(1337,"Dualuziclip",999);
    giveactorinventory(1337,"ak47clip",999);
    giveactorinventory(1337,"Thomsonclip",999);
    giveactorinventory(1337,"Revolverclip",999);
    giveactorinventory(1337,"Revolverammo",999);
    giveactorinventory(1337,"PAPRevolverammo",999);
    giveactorinventory(1337,"Colt45clip",999);
    giveactorinventory(1337,"PAPColt45clip",6);
    giveactorinventory(1337,"Dukeclip",999);
    giveactorinventory(1337,"Raygunclip",999);
    giveactorinventory(1337,"PAPRaygunclip",999);
    giveactorinventory(1337,"PAPuziclip",999);
    giveactorinventory(1337,"Raygunammo",999);
    giveactorinventory(1337,"PAPRaygunammo",999);
    giveactorinventory(1337,"PAPm1clip",999);
    giveactorinventory(1337,"m1ammo",999);
    giveactorinventory(1337,"papm1ammo",999);
    giveactorinventory(1337,"PAPrifleclip",999);
    giveactorinventory(1337,"PAPm16clip",999);
    giveactorinventory(1337,"PAPmp5clip",999);
    giveactorinventory(1337,"PAPmp40clip",999);
    giveactorinventory(1337,"PAPDualuziclip",999);
    giveactorinventory(1337,"PAPak47clip",999);
    giveactorinventory(1337,"PAPThomsonclip",999);
    giveactorinventory(1337,"PAPRevolverclip",999);
    giveactorinventory(1337,"PAPDukeclip",999);
    giveactorinventory(1337,"PlasmaClip",999); 
    giveactorinventory(1337,"PAPPlasmaClip",999);
    giveactorinventory(1337,"PlasmaBeamammo",999);
    giveactorinventory(1337,"PAPAUGClip",999);
    giveactorinventory(1337,"AUGClip",999);
    giveactorinventory(1337,"PAPFAMASClip",999);
    giveactorinventory(1337,"FAMASClip",999);
    giveactorinventory(1337,"BARClip",999);
    giveactorinventory(1337,"BARammo",999);
    giveactorinventory(1337,"PAPBARClip",999);
    giveactorinventory(1337,"PAPBARammo",999);
    giveactorinventory(1337,"ModelClip",999);
    giveactorinventory(1337,"Modelammo",999);
    giveactorinventory(1337,"PAPModelClip",999);
    giveactorinventory(1337,"PAPModelammo",999);
    giveactorinventory(1337,"Cell",999);
    giveactorinventory(1337,"GrenadeAmmo",999);
    giveactorinventory(1337,"MP7Ammo",999);
    giveactorinventory(1337,"MP7clip",999);
    giveactorinventory(1337,"PAPMP7Ammo",999);
    giveactorinventory(1337,"PAPMP7clip",999);
    giveactorinventory(1337,"RifleAmmo",999);
    giveactorinventory(1337,"Rifleclip",999);
    giveactorinventory(1337,"PAPRifleAmmo",999);
    giveactorinventory(1337,"PAPRifleclip",999);
	giveactorinventory(1337,"AA12Clip",999);
	giveactorinventory(1337,"AA12ammo",999);
	giveactorinventory(1337,"PAPAA12Clip",999);
	giveactorinventory(1337,"PAPAA12ammo",999);
	giveactorinventory(1337,"ClaymoreAmmo",999);
	giveactorinventory(1337,"PAPPUMPClip",999);
	giveactorinventory(1337,"PAPPUMPammo",999);
	giveactorinventory(1337,"PUMPClip",999);
	giveactorinventory(1337,"PUMPammo",999);
	giveactorinventory(1337,"UACammo",999);
	giveactorinventory(1337,"PAPUACammo",999);
	giveactorinventory(1337,"UACclip",999);
	giveactorinventory(1337,"PAPUACclip",999);
	giveactorinventory(1337,"SSGammo",999);
	giveactorinventory(1337,"MP40ammo",999);
	giveactorinventory(1337,"PAPMP40ammo",999);
	giveactorinventory(1337,"UziAmmo",999);
	giveactorinventory(1337,"DualUziAmmo",999);
	giveactorinventory(1337,"spellammo",999);
	giveactorinventory(1337,"PAPspellammo",999);
	giveactorinventory(1337,"tommammo",999);
	giveactorinventory(1337,"PAPtommammo",999);
	giveactorinventory(1337,"BFG10kammo",999);
	giveactorinventory(1337,"PAPBFG10kammo",999);
	giveactorinventory(1337,"Chaingunammo",999);
	giveactorinventory(1337,"PAPChaingunammo",999);
	giveactorinventory(1337,"shotgunammo",999);
	giveactorinventory(1337,"MP5ammo",999);
	giveactorinventory(1337,"augammo",999);
	giveactorinventory(1337,"Typeammo",999);
	giveactorinventory(1337,"PAPTypeammo",999);
	giveactorinventory(1337,"PulseMGammo",999);
	giveactorinventory(1337,"PAPPulseMGammo",999);
	giveactorinventory(1337,"scarammo",999);
	giveactorinventory(1337,"papscarammo",999);
	giveactorinventory(1337,"scarclip",999);
	giveactorinventory(1337,"papscarclip",999);
giveactorinventory(1337,"D3Clip",999);
giveactorinventory(1337,"D3Ammo",999);
giveactorinventory(1337,"PAPD3Clip",999);
giveactorinventory(1337,"PAPD3Ammo",999);
giveactorinventory(1337,"PAPSTGClip",999);
giveactorinventory(1337,"PAPSTGAmmo",999);
giveactorinventory(1337,"STGClip",999);
giveactorinventory(1337,"STGAmmo",999);
giveactorinventory(1337,"RAYM2Clip",999);
giveactorinventory(1337,"RAYM2Ammo",999);
giveactorinventory(1337,"PAPRAYM2Clip",999);
giveactorinventory(1337,"PAPRAYM2Ammo",999);
//Player 2//////////////////////////////
giveactorinventory(1338,"DukeAmmo",999);
giveactorinventory(1338,"PAPDukeAmmo",999);
giveactorinventory(1338,"Colt45Ammo",999);
giveactorinventory(1338,"PAPColt45Ammo",999);
giveactorinventory(1338,"AK47Ammo",999);
giveactorinventory(1338,"PAPAK47Ammo",999);
giveactorinventory(1338,"D3Clip",999);
giveactorinventory(1338,"D3Ammo",999);
giveactorinventory(1338,"PAPD3Clip",999);
giveactorinventory(1338,"PAPD3Ammo",999);
	giveactorinventory(1338,"scarammo",999);
	giveactorinventory(1338,"papscarammo",999);
	giveactorinventory(1338,"scarclip",999);
	giveactorinventory(1338,"papscarclip",999);
giveactorinventory(1338,"RPGClip",999);
giveactorinventory(1338,"RPGAmmo",999);
giveactorinventory(1338,"PPSHClip",999);
giveactorinventory(1338,"PPSHAmmo",999);
giveactorinventory(1338,"PAPRPGClip",999);
giveactorinventory(1338,"PAPRPGAmmo",999);
giveactorinventory(1338,"PAPPPSHClip",999);
giveactorinventory(1338,"PAPPPSHAmmo",999);
giveactorinventory(1338,"Flares",999);
giveactorinventory(1338,"PAPFlares",999);
	giveactorinventory(1338,"Typeammo",999);
	giveactorinventory(1338,"PAPTypeammo",999);
	giveactorinventory(1338,"PulseMGammo",999);
	giveactorinventory(1338,"PAPPulseMGammo",999);
	giveactorinventory(1338,"augammo",999);
	giveactorinventory(1338,"MP5ammo",999);
	giveactorinventory(1338,"spellammo",999);
	giveactorinventory(1338,"PAPspellammo",999);
	giveactorinventory(1338,"tommammo",999);
	giveactorinventory(1338,"PAPtommammo",999);
	giveactorinventory(1338,"BFG10kammo",999);
	giveactorinventory(1338,"PAPBFG10kammo",999);
	giveactorinventory(1338,"SSGammo",999);
	giveactorinventory(1338,"MP40ammo",999);
	giveactorinventory(1338,"PAPMP40ammo",999);
	giveactorinventory(1338,"UziAmmo",999);
	giveactorinventory(1338,"DualUziAmmo",999);
	giveactorinventory(1338,"UACammo",999);
	giveactorinventory(1338,"PAPUACammo",999);
	giveactorinventory(1338,"UACclip",999);
	giveactorinventory(1338,"PAPUACclip",999);
	giveactorinventory(1338,"PAPPUMPClip",999);
	giveactorinventory(1338,"PAPPUMPammo",999);
	giveactorinventory(1338,"PUMPClip",999);
	giveactorinventory(1338,"PUMPammo",999);
   giveactorinventory(1338,"PAPQUADclip",999);
   giveactorinventory(1338,"quadclip",999);
   giveactorinventory(1338,"PAPPistolclip",999);
   giveactorinventory(1338,"PAPshotgunclip",999);
   giveactorinventory(1338,"PAPSSGclip",999); 
   giveactorinventory(1338,"PAPchaingunclip",999);    
   giveactorinventory(1338,"chaingunclip",999);   
   giveactorinventory(1338,"ssgclip",999);
    giveactorinventory(1338,"pistolclip",999);
    giveactorinventory(1338,"shotgunclip",999);
    giveactorinventory(1338,"uziclip",999);
    giveactorinventory(1338,"m1clip",999);
    giveactorinventory(1338,"m1ammo",999);
    giveactorinventory(1338,"papm1ammo",999);
    giveactorinventory(1338,"papm1clip",999);
    giveactorinventory(1338,"rifleclip",999);
    giveactorinventory(1338,"m16clip",999);
    giveactorinventory(1338,"mp5clip",999);
    giveactorinventory(1338,"mp40clip",999);
    giveactorinventory(1338,"Dualuziclip",999);
    giveactorinventory(1338,"ak47clip",999);
    giveactorinventory(1338,"Thomsonclip",999);
    giveactorinventory(1338,"Revolverclip",999);
    giveactorinventory(1338,"Revolverammo",999);
    giveactorinventory(1338,"PAPRevolverammo",999);
    giveactorinventory(1338,"Colt45clip",999);
    giveactorinventory(1338,"PAPColt45clip",6);
    giveactorinventory(1338,"Dukeclip",999);
    giveactorinventory(1338,"Raygunclip",999);
    giveactorinventory(1338,"PAPRaygunclip",999);
    giveactorinventory(1338,"PAPuziclip",999);
    giveactorinventory(1338,"Raygunammo",999);
    giveactorinventory(1338,"PAPRaygunammo",999);
    giveactorinventory(1338,"PAPm1clip",999);
    giveactorinventory(1338,"PAPrifleclip",999);
    giveactorinventory(1338,"PAPm16clip",999);
    giveactorinventory(1338,"PAPmp5clip",999);
    giveactorinventory(1338,"PAPmp40clip",999);
    giveactorinventory(1338,"PAPDualuziclip",999);
    giveactorinventory(1338,"PAPak47clip",999);
    giveactorinventory(1338,"PAPThomsonclip",999);
    giveactorinventory(1338,"PAPRevolverclip",999);
    giveactorinventory(1338,"PAPDukeclip",999);
    giveactorinventory(1338,"PlasmaClip",999); 
    giveactorinventory(1338,"PAPPlasmaClip",999);
    giveactorinventory(1338,"PlasmaBeamammo",999);
    giveactorinventory(1338,"PAPAUGClip",999);
    giveactorinventory(1338,"AUGClip",999);
    giveactorinventory(1338,"PAPFAMASClip",999);
    giveactorinventory(1338,"FAMASClip",999);
    giveactorinventory(1338,"BARClip",999);
    giveactorinventory(1338,"BARammo",999);
    giveactorinventory(1338,"PAPBARClip",999);
    giveactorinventory(1338,"PAPBARammo",999);
    giveactorinventory(1338,"ModelClip",999);
    giveactorinventory(1338,"Modelammo",999);
    giveactorinventory(1338,"PAPModelClip",999);
    giveactorinventory(1338,"PAPModelammo",999);
    giveactorinventory(1338,"Cell",999);
    giveactorinventory(1338,"GrenadeAmmo",999);
    giveactorinventory(1338,"MP7Ammo",999);
    giveactorinventory(1338,"MP7clip",999);
    giveactorinventory(1338,"PAPMP7Ammo",999);
    giveactorinventory(1338,"PAPMP7clip",999);
    giveactorinventory(1338,"RifleAmmo",999);
    giveactorinventory(1338,"Rifleclip",999);
    giveactorinventory(1338,"PAPRifleAmmo",999);
    giveactorinventory(1338,"PAPRifleclip",999);
	giveactorinventory(1338,"AA12Clip",999);
	giveactorinventory(1338,"AA12ammo",999);
	giveactorinventory(1338,"PAPAA12Clip",999);
	giveactorinventory(1338,"PAPAA12ammo",999);
	giveactorinventory(1338,"ClaymoreAmmo",999);
    giveactorinventory(1338,"pistolammo",999);
	giveactorinventory(1338,"Chaingunammo",999);
	giveactorinventory(1338,"PAPChaingunammo",999);
	giveactorinventory(1338,"shotgunammo",999);
giveactorinventory(1338,"PAPSTGClip",999);
giveactorinventory(1338,"PAPSTGAmmo",999);
giveactorinventory(1338,"STGClip",999);
giveactorinventory(1338,"STGAmmo",999);
giveactorinventory(1338,"RAYM2Clip",999);
giveactorinventory(1338,"RAYM2Ammo",999);
giveactorinventory(1338,"PAPRAYM2Clip",999);
giveactorinventory(1338,"PAPRAYM2Ammo",999);
}
//DEATH AND RESPAWN////////////////////////////////////////////////////////
script 997 RESPAWN
{
    //If everyone is dead, disallow respawning
    if(GetActorProperty(1337,APROP_Health)<=0 &&
       GetActorProperty(1338,APROP_Health)<=0 && gameover==0)
    {
        DamageThing(9999);
        P1Death = 1;
        P2Death = 1;
    }
    
       //Reset ID and respawn if wave is not in progress and someone is alive
    else if(waveInProgress==0)
    {
        //Erase spectator message
        HudMessage(s:""; HUDMSG_PLAIN, 4, CR_ORANGE, 0.50, 0.10, 1);
        
        if(PlayerNumber()==0 && P1Death==1  && Gameover==0)
        {//Player 1
		level = GetLevelInfo(LEVELINFO_LEVELNUM);
		if(level==15)
		{
		 if(checkactorinventory(1337,"PlasmaBeam")>0 || checkactorinventory(1337,"PAPPlasmaBeam")>0)
            {
            buildstage = 0;
            buildpart1 = 0;
            buildpart2 = 0;
            buildpart3 = 0;
            buildpart4 = 0;
            SpawnSpotFacing("PlasmaBeampart1",18,999);
            SpawnSpotFacing("PlasmaBeampart2",19,999);
            SpawnSpotFacing("PlasmaBeampart3",20,999);
            SpawnSpotFacing("PlasmaBeampart4",21,999);
            }
		}
            Thing_ChangeTid(1337,0);
            Thing_ChangeTid(0,1337);
			Removeweaponsp1();
	takeinventory("mulekickmaxweapons",3);
            giveactorinventory(1337,"normalpistol",1);
            giveactorinventory(1337,"Pistolammo",999);
            setweapon("Normalpistol");
	giveinventory("mulekickmaxweapons",1);
            //Reset inventory          
            P1Death = 0;
            ACS_execute(800,0,0,0,0);
            ACS_execute(988,0,0,0,0);
			acs_execute(411,0,0,0,0);
        }
        else if(PlayerNumber()==1 && P2Death==1  && Gameover==0)
        {//Player 2level = GetLevelInfo(LEVELINFO_LEVELNUM);
		if(level==15)
		{
		 if(checkactorinventory(1338,"PlasmaBeam")>0 || checkactorinventory(1338,"PAPPlasmaBeam")>0)
            {
            buildstage = 0;
            buildpart1 = 0;
            buildpart2 = 0;
            buildpart3 = 0;
            buildpart4 = 0;
            SpawnSpotFacing("PlasmaBeampart1",18,999);
            SpawnSpotFacing("PlasmaBeampart2",19,999);
            SpawnSpotFacing("PlasmaBeampart3",20,999);
            SpawnSpotFacing("PlasmaBeampart4",21,999);
            }
		}
            Thing_ChangeTid(1338,0);
            Thing_ChangeTid(0,1338);
			Removeweaponsp2();
	takeinventory("mulekickmaxweapons",3);
            giveactorinventory(1338,"normalpistol",1);
            giveactorinventory(1338,"Pistolammo",999);
            setweapon("Normalpistol");
	giveinventory("mulekickmaxweapons",1);
            P2Death = 0;
            ACS_execute(801,0,0,0,0);
            ACS_execute(989,0,0,0,0);
			acs_execute(413,0,0,0,0);
        }
    }
    //Kill respawners if wave is still in progress
    if(waveInProgress==1  && Gameover==0)
    {
        //Kill respawner
        DamageThing(9999);
        
        //Tell him he can't respawn yet
        HudMessage(s:"CAN'T RESPAWN!  WAVE IN PROGRESS."; HUDMSG_FADEOUT, 5, CR_ORANGE, 0.50, 0.15, 3.0, 0.5);
    }
	
    //GameoverKill
    else if(Gameover==1)
    {
        //Kill respawner
        DamageThing(9999);
		     Uammo = 0;
		     insta = 0;
        timeon = 0;
        HudMessage(s:""; HUDMSG_PLAIN, 4, CR_ORANGE, 0.50, 0.10, 1);
        HudMessage(s:"";HUDMSG_PLAIN, 97, CR_White, 0.50, 0.15, 1);
        HudMessage(s:"";HUDMSG_PLAIN, 96, CR_White, 0.50, 0.15, 1);
        if(gameskill()!=4)
        {
        HudMessage(s:"You surived ",
                   d: waveNumber,
                   s:" Rounds"; HUDMSG_PLAIN, 5, CR_White, 0.50, 0.2, 1);
        }
        else if(gameskill()==4)
        {
        HudMessage(s:"You surived ", d:minutes,s:":",d:seconds;
        HUDMSG_PLAIN, 5, CR_White, 0.50, 0.2, 1);
        }
        HudMessage(s:"kills"; HUDMSG_PLAIN, 12, CR_red, 0.90, 0.25, 1);
        HudMessage(s:"score"; HUDMSG_PLAIN, 13, CR_red, 0.70, 0.25, 1);
        //player1/////////////////////////////////
        HudMessage(s:" ",
                   n:1; HUDMSG_PLAIN, 6, CR_White, 0.10, 0.4, 1);
        HudMessage(d: pointsp1; HUDMSG_PLAIN, 7, CR_White, 0.70, 0.4, 1);
        HudMessage(d: p1kills; HUDMSG_PLAIN, 8, CR_White, 0.90, 0.4, 1);
        //player2/////////////////////////////////
		if(PlayerCount()>1) 
		{
        HudMessage(n:2; HUDMSG_PLAIN, 9, CR_yellow, 0.10, 0.5, 1);
        HudMessage(d: pointsp2; HUDMSG_PLAIN, 10, CR_yellow, 0.70, 0.5, 1);
        HudMessage(d: p2kills; HUDMSG_PLAIN, 11, CR_yellow, 0.90, 0.5, 1);
   }
    
    }
}

script 998 DEATH
{    
    //Player 1 Death
    if(PlayerNumber()==0)
    {
        P1Death = 1;
        //Stop perks
		If(P1SS==0)
		{
        P1DT = 0;
        P1SC = 0;
        P1QR = 0;
        P1JN = 0;
        P1SU = 0;
        P1DS = 0;
        P1PHD = 0;
        P1SS = 0;  
        P1MK = 0;  
		P1PerkBought[1]=0; P1PerkBoughtName[1]="";
        P1PerkBought[2]=0; P1PerkBoughtName[2]="";
        P1PerkBought[3]=0; P1PerkBoughtName[3]="";
        P1PerkBought[4]=0; P1PerkBoughtName[4]="";
        P1PerkBought[5]=0; P1PerkBoughtName[5]="";
        P1PerkBought[6]=0; P1PerkBoughtName[6]="";
        P1PerkBought[7]=0; P1PerkBoughtName[7]="";
        P1PerkBought[8]=0; P1PerkBoughtName[8]="";
        P1PerkBought[9]=0; P1PerkBoughtName[9]="";
        takeactorinventory(1337,"speedcola",1);
        takeactorinventory(1337,"Doubletap",1);
        takeactorinventory(1337,"QuickRevive",1);
        takeactorinventory(1337,"Juggernog",1);
        takeactorinventory(1337,"staminaup",1);
        takeactorinventory(1337,"PhDflopper",1);
        takeactorinventory(1337,"PHD",1);
        takeactorinventory(1337,"mulekick",1);
        //Player 2's cam
		}
		else if(P1SS==1)
		{
        P1SS = 0;
		 if(P1PerkBoughtName[1]=="SS"){P1PerkBought[1]=0; P1PerkBoughtName[1]="";}
		 else if(P1PerkBoughtName[2]=="SS"){P1PerkBought[2]=0; P1PerkBoughtName[2]="";}
		 else if(P1PerkBoughtName[3]=="SS"){P1PerkBought[3]=0; P1PerkBoughtName[3]="";}
		 else if(P1PerkBoughtName[4]=="SS"){P1PerkBought[4]=0; P1PerkBoughtName[4]="";}
		 else if(P1PerkBoughtName[5]=="SS"){P1PerkBought[5]=0; P1PerkBoughtName[5]="";}
		 else if(P1PerkBoughtName[6]=="SS"){P1PerkBought[6]=0; P1PerkBoughtName[6]="";}
		 else if(P1PerkBoughtName[7]=="SS"){P1PerkBought[7]=0; P1PerkBoughtName[7]="";}
		 else if(P1PerkBoughtName[8]=="SS"){P1PerkBought[8]=0; P1PerkBoughtName[8]="";}
		 else if(P1PerkBoughtName[9]=="SS"){P1PerkBought[9]=0; P1PerkBoughtName[9]="";}
		}
        if(PlayerCount()==2 && GetActorProperty(1338,APROP_Health)>0 && Gameover==0 && P2Death==0)
        {
            HudMessage(s:"SPECTATING PLAYER 2"; HUDMSG_PLAIN, 4, CR_ORANGE, 0.50, 0.1, 1);
            ChangeCamera(1338, 1337, 0);
        }
    }
    //Player 2 Death
    else if(PlayerNumber()==1)
    {
        P2Death = 1;
	If(P2SS==0)
	{
        //Stop perks
        P2DT = 0;
        P2SC = 0;
        P2QR = 0;
        P2JN = 0;
        P2SU = 0;
        P2DS = 0;
        P2PHD =0;
        P2SS = 0;
        P2MK = 0;
		P2PerkBought[1]=0; P2PerkBoughtName[1]="";
        P2PerkBought[2]=0; P2PerkBoughtName[2]="";
        P2PerkBought[3]=0; P2PerkBoughtName[3]="";
        P2PerkBought[4]=0; P2PerkBoughtName[4]="";
        P2PerkBought[5]=0; P2PerkBoughtName[5]="";
        P2PerkBought[6]=0; P2PerkBoughtName[6]="";
        P2PerkBought[7]=0; P2PerkBoughtName[7]="";
        P2PerkBought[8]=0; P2PerkBoughtName[8]="";
        P2PerkBought[9]=0; P2PerkBoughtName[9]="";
        takeactorinventory(1338,"speedcola",1);
        takeactorinventory(1338,"Doubletap",1);
        takeactorinventory(1338,"QuickRevive",1);
        takeactorinventory(1338,"Juggernog",1);
        takeactorinventory(1338,"staminaup",1);
        takeactorinventory(1338,"PhDflopper",1);
        takeactorinventory(1338,"PHD",1);
        takeactorinventory(1338,"mulekick",1);
        }
		else if(P2SS==1)
		{
        P2SS = 0;
		 if(P2PerkBoughtName[1]=="SS"){P2PerkBought[1]=0; P2PerkBoughtName[1]="";}
		 else if(P2PerkBoughtName[2]=="SS"){P2PerkBought[2]=0; P2PerkBoughtName[2]="";}
		 else if(P2PerkBoughtName[3]=="SS"){P2PerkBought[3]=0; P2PerkBoughtName[3]="";}
		 else if(P2PerkBoughtName[4]=="SS"){P2PerkBought[4]=0; P2PerkBoughtName[4]="";}
		 else if(P2PerkBoughtName[5]=="SS"){P2PerkBought[5]=0; P2PerkBoughtName[5]="";}
		 else if(P2PerkBoughtName[6]=="SS"){P2PerkBought[6]=0; P2PerkBoughtName[6]="";}
		 else if(P2PerkBoughtName[7]=="SS"){P2PerkBought[7]=0; P2PerkBoughtName[7]="";}
		 else if(P2PerkBoughtName[8]=="SS"){P2PerkBought[8]=0; P2PerkBoughtName[8]="";}
		 else if(P2PerkBoughtName[9]=="SS"){P2PerkBought[9]=0; P2PerkBoughtName[9]="";}
		}
        //Player 1's cam
        if(GetActorProperty(1337,APROP_Health)>0 && Gameover==0 && P1Death==0)
        {
            HudMessage(s:"SPECTATING PLAYER 1"; HUDMSG_PLAIN, 4, CR_ORANGE, 0.50, 0.1, 1);
            ChangeCamera(1337, 1338, 0);
        }
    }
    
    //Everyone-Dead message, then restart game
    if(GetActorProperty(1337,APROP_Health)<=0 &&
        GetActorProperty(1338,APROP_Health)<=0 && Gameover==0)
    {
        Acs_Execute(999,0,0,0,0);
}
}

