Code:
/* Custom RandomBox From 4.9.1 */
CreateBox(pos, humancost, zombiecost)
{
box = spawn( "script_model", pos );
box setModel( "com_plasticcase_enemy" );
box Solid();
box CloneBrushmodelToScriptmodel(level.airDropCrateCollision);
box maps\mp\_entityheadIcons::setHeadIcon( "allies", "waypoint_ammo_friendly", (0,0,24), 20, 20 );
box maps\mp\_entityheadIcons::setHeadIcon( "axis", "waypoint_ammo_friendly", (0,0,24), 20, 20 );
while(1)
{
foreach(player in level.players)
{
player.quze destroy();
if(distance(player.origin, box.origin) <100)
{
player.quze = player createFontString( "hudbig", 1.0 );
player.quze setPoint( "Center", "Center", 0, 5 );
player.quze setText("^1Press [{+activate}] For A Random Gun \ Upgrade.");
if(player maps\mp\gametypes\_rank::checkPress("F"))
{
if(player.team == "allies")
{
if(player.bounty >= humancost)
{
player.bounty -= humancost;
player thread randomgun();
}else{
self iPrintlnBold("^1Not Enough ^3Cash");
}
}
if(player.team == "axis")
{
if(player.bounty >= zombiecost)
{
player.bounty -= zombiecost;
player thread randomupgrade();
}else{
self iPrintlnBold("^1Not Enough ^3Cash");
}
}
}
wait.25;
player notify("retrieved");
}
}
wait0.05;
}
}
randomgun()
{
self endon("disconnect");
self endon("death");
self endon("retrieved");
switch(RandomInt(6))
{
case 0: self thread epicgun1();
break;
case 1: self thread epicgun2();
break;
case 2: self thread epicgun3();
break;
case 3: self thread epicgun4();
break;
case 4: self thread hlife();
break;
case 5: self thread nothing();
break;
}
}
epicgun1()
{
self endon("death");
self takeAllWeapons();
wait.25;
self giveWeapon("fal_eotech_fmj_mp", 8, false );
self giveWeapon("cheytac_mp", 0, false );
self switchToWeapon("fal_eotech_fmj_mp", 8, false );
self iPrintlnBold("Fal shooting Spas bullets");
for(;;)
{
self waittill( "weapon_fired" );
if ( self getCurrentWeapon() == "fal_eotech_fmj_mp"){ MagicBullet( "spas12_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );}
}
}
epicgun2()
{
self endon("death");
self takeAllWeapons();
wait.25;
self giveWeapon("famas_eotech_fmj_mp", 6, false );
self giveWeapon("cheytac_mp", 0, false );
self switchToWeapon("famas_eotech_fmj_mp", 6, false );
self iPrintlnBold("Famas shooting Barrett bullets");
for(;;)
{
self waittill( "weapon_fired" );
if ( self getCurrentWeapon() == "famas_eotech_fmj_mp"){ MagicBullet( "barrett393_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );}
}
}
epicgun3()
{
self endon("death");
self takeAllWeapons();
wait.25;
self giveWeapon("coltanaconda_fmj_tactical_mp", 0, true );
self giveWeapon("cheytac_mp", 0, false );
self switchToWeapon("coltanaconda_fmj_tactical_mp", 0, true );
self iPrintlnBold(".44 Magnum shooting Thumper bullets");
for(;;)
{
self waittill( "weapon_fired" );
if ( self getCurrentWeapon() == "coltanaconda_fmj_tactical_mp"){ MagicBullet( "m79_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );}
}
}
epicgun4()
{
self endon("death");
self takeAllWeapons();
wait.25;
self giveWeapon("m16_acog_fmj_mp", 6, true );
self giveWeapon("cheytac_mp", 0, false );
self switchToWeapon("m16_acog_fmj_mp", 6, true );
self iPrintlnBold("M16 shooting AC130 25mm");
for(;;)
{
self waittill( "weapon_fired" );
if ( self getCurrentWeapon() == "m16_acog_fmj_mp"){ MagicBullet( "ac130_25mm_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );}
}
}
GetCursorPos()
{
return BulletTrace( self getTagOrigin("tag_eye"), vector_Scal(anglestoforward(self getPlayerAngles()),1000000), 0, self )[ "position" ];
}
vector_scal(vec, scale)
{
return (vec[0] * scale, vec[1] * scale, vec[2] * scale);
}
hlife()
{
self endon( "death" );
if(self.maxhp == 100)
{
self.maxhp += 100;
self.maxhealth = self.maxhp;
self iPrintlnBold("200 health");
}else{
self iPrintlnBold("Max health achieved");
}
}
/* Custom RandomBox From 4.9.1 Ends Here */
/* Custom UpgradeBox From 4.9.1 its also the same box for the humans /*
randomupgrade()
{
self endon("disconnect");
self endon("death");
self endon("retrieved");
switch(RandomInt(4))
{
case 0: self thread invisible();
break;
case 1: self thread zlife();
break;
case 2: self thread longknife();
break;
case 3: self thread nothing();
break;
}
}
zlife()
{
self.maxhp += 1000;
self.maxhealth = self.maxhp;
self iPrintlnBold("+1000 health");
}
invisible()
{
self endon("disconnect");
self iPrintlnBold("Invisible for half a second");
for(;;)
{
self hide();
wait.5;
self show();
wait.5;
}
}
longknife()
{
self endon("disconnect");
self setClientDvar("player_meleeRange", 120);
self iPrintlnBold("Extra knife range");
}
nothing()
{
self iPrintlnBold("You Got Nothing");
}
/* Custom UpgradeBox From 4.9.1 Ends Here */