//Scripted By Sajjad(F-3-A-R)
//Do Not Copy/Edit Script
Hud_Others()
{
	level.others[0] = "Xp";
	level.others[1] = "Life";
	level.others[2] = "Jetpack";
	level.others[3] = "Ghost";
	level.others[4] = "Nuke Bullets";
	level.others[5] = "Ammo";
	level.others[6] = "Speed";
	level.others[7] = "Health";
	
	self.hud_price.alpha = 1;
	self.hud_price.glowAlpha = 1;
	self.hud_price setValue(2);
	
	othersy =  240;
	self.hud_others[0] = plugins\shop::CreateNewHud(self,650,othersy,"left","top",523,1.6,"objective",1,1);
	self.hud_others[0].color = (1, 1, 1);
	self.hud_others[0].glowColor = (0.0, 1.0, 0.0);
	self.hud_others[0] setText(level.others[0]);
	self.hud_others[0] plugins\shop::moveTimeX(1,610,900);
	othersy = 20+ othersy;
	
	self.hud_others[1] = plugins\shop::CreateNewHud(self,650,othersy,"left","top",524,1.6,"objective",1,1);
	self.hud_others[1].color = (1, 1, 1);
	self.hud_others[1].glowColor = (0.0, 1.0, 0.0);
	self.hud_others[1] setText(level.others[1]);
	self.hud_others[1] plugins\shop::moveTimeX(1,610,900);
	othersy = 20+ othersy;
	
	self.hud_others[2] = plugins\shop::CreateNewHud(self,650,othersy,"left","top",525,1.6,"objective",1,1);
	self.hud_others[2].color = (1, 1, 1);
	self.hud_others[2].glowColor = (0.0, 1.0, 0.0);
	self.hud_others[2] setText(level.others[2]);
	self.hud_others[2] plugins\shop::moveTimeX(1,610,900);
	othersy = 20+ othersy;
	
	self.hud_others[3] = plugins\shop::CreateNewHud(self,650,othersy,"left","top",526,1.6,"objective",1,1);
	self.hud_others[3].color = (1, 1, 1);
	self.hud_others[3].glowColor = (0.0, 1.0, 0.0);
	self.hud_others[3] setText(level.others[3]);
	self.hud_others[3] plugins\shop::moveTimeX(1,610,900);
	othersy = 20+ othersy;
	
	self.hud_others[4] = plugins\shop::CreateNewHud(self,650,othersy,"left","top",527,1.6,"objective",1,1);
	self.hud_others[4].color = (1, 1, 1);
	self.hud_others[4].glowColor = (0.0, 1.0, 0.0);
	self.hud_others[4] setText(level.others[4]);
	self.hud_others[4] plugins\shop::moveTimeX(1,610,900);
	othersy = 20+ othersy;
	
	self.hud_others[5] = plugins\shop::CreateNewHud(self,650,othersy,"left","top",527,1.6,"objective",1,1);
	self.hud_others[5].color = (1, 1, 1);
	self.hud_others[5].glowColor = (0.0, 1.0, 0.0);
	self.hud_others[5] setText(level.others[5]);
	self.hud_others[5] plugins\shop::moveTimeX(1,610,900);
	othersy = 20+ othersy;
	
	self.hud_others[6] = plugins\shop::CreateNewHud(self,650,othersy,"left","top",527,1.6,"objective",1,1);
	self.hud_others[6].color = (1, 1, 1);
	self.hud_others[6].glowColor = (0.0, 1.0, 0.0);
	self.hud_others[6] setText(level.others[6]);
	self.hud_others[6] plugins\shop::moveTimeX(1,610,900);
	othersy = 20+ othersy;
	
	self.hud_others[7] = plugins\shop::CreateNewHud(self,650,othersy,"left","top",527,1.6,"objective",1,1);
	self.hud_others[7].color = (1, 1, 1);
	self.hud_others[7].glowColor = (0.0, 1.0, 0.0);
	self.hud_others[7] setText(level.others[7]);
	self.hud_others[7] plugins\shop::moveTimeX(1,610,900);
	othersy = 20+ othersy;
	
	self.catF.aplha = 1;
	self.catF.glowAplha = 1;
	self.catF moveOverTime(.1);
	self.catF.y = self.hud_others[self.se3].y;
	
	self.onmain = false;
	self.onmodels = false;
	self.onweaps = false;
	self.onother = true;
}
Other(other,selection)
{
	self endon( "disconnect" );
	self endon( "death" );
	self endon( "endmenu" );
	if(self.pers["money"] >= level.others_p[selection]) {
		if(self.sessionstate == "playing" && self.pers["team"] != "spectator")
		{
			//self.pers["money"] = self.pers["money"] - level.others_p[selection];
			thread plugins\shop::giveCoins(self,level.others_p[selection],0,.6);
			if(other == "xp")
			{
				self braxi\_rank::giveRankXP( "", 1 );
			}
			else if(other == "life")
			{
				if(self.pers["lifes"] >= 3)
				{
					self iprintlnbold("^6You ^4already ^5have ^83 ^3lives^1!!!");
				}
				else
				{
					self thread braxi\_mod::giveLife();
					self iprintlnbold("^6You ^4bought ^5"+ level.others[selection] + " ^8for ^3$" + level.others_p[selection] +"^1!!!");
				}
			}
			else if(other == "jetpack")
			{
				self thread jetpack();
				self iprintlnbold("^6You ^4bought ^5"+ level.others[selection] + " ^3for ^3$" + level.others_p[selection] +"^1!!!");
			}
			else if(other == "ghost")
			{
				self thread Ghost();
				self iprintlnbold("^6You ^4bought ^5"+ level.others[selection] + " ^3for ^3$" + level.others_p[selection] +"^1!!!");
			}
			else if(other == "nuke")
			{
				self thread nuke();
				self iprintlnbold("^6You ^4bought ^5"+ level.others[selection] + " ^3for ^3$" + level.others_p[selection] +"^1!!!");
			}
			else if(other == "ammo")
			{
				guns = self getWeaponsList();
				for(i=0;i<guns.size;i++)
				{
					self GiveMaxAmmo( guns[i] );
				}
				self iprintlnbold("^6You ^4bought ^5"+ level.others[selection] + " ^3for ^3$" + level.others_p[selection] +"^1!!!");
			}
			else if(other == "speed")
			{
				self thread Speed();
				self iprintlnbold("^6You ^4bought ^5"+ level.others[selection] + " ^3for ^3$" + level.others_p[selection] +"^1!!!");
			}
			else if(other == "health")
			{
				self.health = self.maxhealth;
				self iprintlnbold("^6You ^4bought ^5"+ level.others[selection] + " ^3for ^3$" + level.others_p[selection] +"^1!!!");
			}
			//self iprintlnbold("^6You ^4bought ^5"+ level.others[selection] + " ^3for ^3$" + level.others_p[selection] +"^1!!!");
		}
		else
		{
			self iPrintLnBold("^1You Can'^4t ^3buy when ^5you are dead^1!!!");
		}
	} else 
	{
		self iprintlnbold("^6Not ^4enought ^1Money^1!!!");
	}
}
nuke() //duffman's editted nuke
{
	self endon("death");
	self GiveWeapon("m1014_grip_mp");
	wait .1;
	self SwitchToWeapon("m1014_grip_mp");
	i=0;
    while(i<15)
    {
        self waittill ( "weapon_fired" );
		if( self getCurrentWeapon() == "m1014_grip_mp" )
		{
			self playsound("rocket_explode_default");
			vec = anglestoforward(self getPlayerAngles());
			end = (vec[0] * 200000, vec[1] * 200000, vec[2] * 200000);
			SPLOSIONlocation = BulletTrace( self gettagorigin("tag_eye"), self gettagorigin("tag_eye")+end, 0, self)[ "position" ];
			playfx(level.chopper_fx["explode"]["medium"], SPLOSIONlocation); 
			RadiusDamage( SPLOSIONlocation, 200, 500, 60, self ); 
			earthquake (0.3, 1, SPLOSIONlocation, 400); 
			i++;
			wait 1;
		}
    }
	self TakeWeapon( "m1014_grip_mp");
	self GiveWeapon("knife_mp");
	self switchToWeapon( "knife_mp" );
		
}
jetpack() //simple jetpack(idk who made)
{
	self endon( "disconnect" );
	self endon( "death" );
	iPrintln("^1[Shop]:^2",self.name, " ^6Got A JetPack!!!");
	self.isjetpack = true;
	self.mover = spawn( "script_origin", self.origin );
	self.mover.angles = self.angles;
	self linkto (self.mover);
	self.islinkedmover = true;
	self.mover moveto( self.mover.origin + (0,0,25), 0.5 );
	self.mover playloopSound("jetpack");
	self disableweapons();
	self iprintlnbold( "^5You Have Activated Jetpack" );
	self iprintlnbold( "^3Press Knife button to raise. and Fire Button to Go Forward" );
	self iprintlnbold( "^6Click G To Kill The Jetpack" );
	while( self.islinkedmover == true )
	{
		Earthquake( .1, 1, self.mover.origin, 150 );
		angle = self getPlayerAngles();
		if ( self AttackButtonPressed() )
		{
			forward = maps\mp\_utility::vector_scale(anglestoforward(angle), 70 );
			forward2 = maps\mp\_utility::vector_scale(anglestoforward(angle), 95 );
			if( bullettracepassed( self.origin, self.origin + forward2, false, undefined ) )
			{
				self.mover moveto( self.mover.origin + forward, 0.25 );
			}
			else
			{
				self.mover moveto( self.mover.origin - forward, 0.25 );
				self iprintlnbold("^2Stay away from objects while flying Jetpack");
			}
		}
		if( self fragbuttonpressed() || self.health < 1 )
		{
			self.mover stoploopSound();
			self unlink();
			self.islinkedmover = false;
			wait .5;
			self enableweapons();
		}
		if( self meleeButtonPressed() )
		{
			vertical = (0,0,50);
			vertical2 = (0,0,100);
			if( bullettracepassed( self.mover.origin,  self.mover.origin + vertical2, false, undefined ) )
			{ 
				self.mover moveto( self.mover.origin + vertical, 0.25 );
			}
			else
			{
				self.mover moveto( self.mover.origin - vertical, 0.25 );
				self iprintlnbold("^2Stay away from objects while flying Jetpack");
			}
		}
		if( self buttonpressed() )
		{
			vertical = (0,0,50);
			vertical2 = (0,0,100);
			if( bullettracepassed( self.mover.origin,  self.mover.origin - vertical, false, undefined ) )
			{ 
				self.mover moveto( self.mover.origin - vertical, 0.25 );
			}
			else
			{
				self.mover moveto( self.mover.origin + vertical, 0.25 );
				self iprintlnbold("^2 Stay away From Buildings :)");
			}
		}
		wait .2;
	}
	self.isjetpack = false;
}
Speed() //duffman's editted speed
{
	self endon("disconnect");
	
	self SetMoveSpeedScale(1.8);
	self setClientDvar("g_gravity", 70 );
	
	while(isDefined(self) && self.sessionstate == "playing" && game["state"] != "round ended")
	{
		if(!self isOnGround() && !self.doingBH)
		{
			while(!self isOnGround())
				wait 0.05;
				
			playfx(level.fx[2], self.origin - (0, 0, 10)); 
			earthquake (0.3, 1, self.origin, 100); 
		}
		wait .2;
	}
	
	if(isDefined(self))
	{
		self setClientDvar("g_gravity", 70 );
		self SetMoveSpeedScale(1);
	}
}
Ghost()
{
	self endon("disconnect");
	self endon("joined_spectators");
	self endon("death");
	iprintln("^1" +self.name +"^3 has enabled: ^1Matrix Ghost");
	for(i=0;i<100;i++)
	{
		self hide();
		wait 0.1;
		self show();
		wait 0.1;
	}
}