Post: [SCRIPT] Pack-a-Punch
02-19-2012, 03:32 AM #1
Choco
Respect my authoritah!!
(adsbygoogle = window.adsbygoogle || []).push({}); Thanks infinitycl for the idea Smile

This is just a conversion of an old MW2 mod, I forget who made it. Not sure if it's been converted before but here goes..

Make sure you have this in init():

    level.expbullt = loadfx("explosions/grenadeExp_concrete_1");


Thread it like this:

    self thread doPack();


And here's the script itself:

    doPack()
{
if(isDefined(level.packpunch))
{
self iPrintln("Pack-a-Punch is already spawned!");
}
else
{
self iPrintln("Pack-a-punch spawned");
self iPrintln("Approach it and press [{+usereload}] to upgrade your weapon");
level.packpunch = spawn("script_model", self.origin+(0, 50, 0));
level.packpunch.angles = (0,90,0);
level.packpunch setModel( "com_plasticcase_beige_big" );
level.packpunch setContents(1);
for(i=0;i<=level.players.size;i++)
{
level.players[i] thread doPack2();
}
}
}

doPack2()
{
for(;Winky Winky
{
if(distance(self.origin,level.packpunch.origin)<50)
{
if(self usebuttonpressed())
{
weap = self getCurrentWeapon();
if( self.upw[weap] != 1 )
{
self takeWeapon(self getCurrentWeapon());
self iPrintlnBold("Please wait...");
wait 4;
self iPrintlnBold("Done!");
self.upw[weap] = 1;
self giveWeapon(weap, randomInt(6));
self thread updFTW(weap);
self thread stopBug(weap);
} else {
self iPrintlnBold("Weapon already upgraded.");
wait 1;
}
}
}
wait 0.05;
}
}
stopBug(gun)
{
self waittill("death");
self.upw[gun] = 0;
}
updFTW( gun )
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
self waittill("weapon_fired");
weap=self getCurrentWeapon();
if(weap==gun)
{
forward=self getTagOrigin("j_head");
end=self thread maps\mp\_utility::vector_scale(anglestoforward(self getPlayerAngles()),1000000);
SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
playfx(level.expbullt, SPLOSIONlocation);
RadiusDamage( SPLOSIONlocation, 300, 200, 100, self );
}
}
}


This spawns a care package that is a pack a punch machine. Any player in the game can approach it and press Square to upgrade their gun. When you upgrade your gun, it gives you explosive bullets and a random camo.

Enjoy everyone Smile
(adsbygoogle = window.adsbygoogle || []).push({});

The following 3 users say thank you to Choco for this useful post:

Correy, iiReFuZee, Jacob-And-Britt
02-19-2012, 03:39 AM #2
xKtF
In my man cave
Originally posted by .Choco View Post
Thanks infinitycl for the idea Smile

This is just a conversion of an old MW2 mod, I forget who made it. Not sure if it's been converted before but here goes..

Make sure you have this in init():

    level.expbullt = loadfx("explosions/grenadeExp_concrete_1");


Thread it like this:

    self thread doPack();


And here's the script itself:

    doPack()
{
if(isDefined(level.packpunch))
{
self iPrintln("Pack-a-Punch is already spawned!");
}
else
{
self iPrintln("Pack-a-punch spawned");
self iPrintln("Approach it and press [{+usereload}] to upgrade your weapon");
level.packpunch = spawn("script_model", self.origin+(0, 50, 0));
level.packpunch.angles = (0,90,0);
level.packpunch setModel( "com_plasticcase_beige_big" );
level.packpunch setContents(1);
for(i=0;i<=level.players.size;i++)
{
level.players[i] thread doPack2();
}
}
}

doPack2()
{
for(;Winky Winky
{
if(distance(self.origin,level.packpunch.origin)<50)
{
if(self usebuttonpressed())
{
weap = self getCurrentWeapon();
if( self.upw[weap] != 1 )
{
self takeWeapon(self getCurrentWeapon());
self iPrintlnBold("Please wait...");
wait 4;
self iPrintlnBold("Done!");
self.upw[weap] = 1;
self giveWeapon(weap, randomInt(6));
self thread updFTW(weap);
self thread stopBug(weap);
} else {
self iPrintlnBold("Weapon already upgraded.");
wait 1;
}
}
}
wait 0.05;
}
}
stopBug(gun)
{
self waittill("death");
self.upw[gun] = 0;
}
updFTW( gun )
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
self waittill("weapon_fired");
weap=self getCurrentWeapon();
if(weap==gun)
{
forward=self getTagOrigin("j_head");
end=self thread maps\mp\_utility::vector_scale(anglestoforward(self getPlayerAngles()),1000000);
SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
playfx(level.expbullt, SPLOSIONlocation);
RadiusDamage( SPLOSIONlocation, 300, 200, 100, self );
}
}
}


This spawns a care package that is a pack a punch machine. Any player in the game can approach it and press Square to upgrade their gun. When you upgrade your gun, it gives you explosive bullets and a random camo.

Enjoy everyone Smile

lol u created this kinda faststare
02-19-2012, 05:53 AM #3
Correy
I'm the Original
Originally posted by .Choco View Post
Thanks infinitycl for the idea Smile

This is just a conversion of an old MW2 mod, I forget who made it. Not sure if it's been converted before but here goes..

Make sure you have this in init():

    level.expbullt = loadfx("explosions/grenadeExp_concrete_1");


Thread it like this:

    self thread doPack();


And here's the script itself:

    doPack()
{
if(isDefined(level.packpunch))
{
self iPrintln("Pack-a-Punch is already spawned!");
}
else
{
self iPrintln("Pack-a-punch spawned");
self iPrintln("Approach it and press [{+usereload}] to upgrade your weapon");
level.packpunch = spawn("script_model", self.origin+(0, 50, 0));
level.packpunch.angles = (0,90,0);
level.packpunch setModel( "com_plasticcase_beige_big" );
level.packpunch setContents(1);
for(i=0;i<=level.players.size;i++)
{
level.players[i] thread doPack2();
}
}
}

doPack2()
{
for(;Winky Winky
{
if(distance(self.origin,level.packpunch.origin)<50)
{
if(self usebuttonpressed())
{
weap = self getCurrentWeapon();
if( self.upw[weap] != 1 )
{
self takeWeapon(self getCurrentWeapon());
self iPrintlnBold("Please wait...");
wait 4;
self iPrintlnBold("Done!");
self.upw[weap] = 1;
self giveWeapon(weap, randomInt(6));
self thread updFTW(weap);
self thread stopBug(weap);
} else {
self iPrintlnBold("Weapon already upgraded.");
wait 1;
}
}
}
wait 0.05;
}
}
stopBug(gun)
{
self waittill("death");
self.upw[gun] = 0;
}
updFTW( gun )
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
self waittill("weapon_fired");
weap=self getCurrentWeapon();
if(weap==gun)
{
forward=self getTagOrigin("j_head");
end=self thread maps\mp\_utility::vector_scale(anglestoforward(self getPlayerAngles()),1000000);
SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
playfx(level.expbullt, SPLOSIONlocation);
RadiusDamage( SPLOSIONlocation, 300, 200, 100, self );
}
}
}


This spawns a care package that is a pack a punch machine. Any player in the game can approach it and press Square to upgrade their gun. When you upgrade your gun, it gives you explosive bullets and a random camo.

Enjoy everyone Smile


not bad choco Enzo

---------- Post added at 05:53 AM ---------- Previous post was at 05:06 AM ----------

Originally posted by .Choco View Post
Thanks infinitycl for the idea Smile

This is just a conversion of an old MW2 mod, I forget who made it. Not sure if it's been converted before but here goes..

Make sure you have this in init():

    level.expbullt = loadfx("explosions/grenadeExp_concrete_1");


Thread it like this:

    self thread doPack();


And here's the script itself:

    doPack()
{
if(isDefined(level.packpunch))
{
self iPrintln("Pack-a-Punch is already spawned!");
}
else
{
self iPrintln("Pack-a-punch spawned");
self iPrintln("Approach it and press [{+usereload}] to upgrade your weapon");
level.packpunch = spawn("script_model", self.origin+(0, 50, 0));
level.packpunch.angles = (0,90,0);
level.packpunch setModel( "com_plasticcase_beige_big" );
level.packpunch setContents(1);
for(i=0;i<=level.players.size;i++)
{
level.players[i] thread doPack2();
}
}
}

doPack2()
{
for(;Winky Winky
{
if(distance(self.origin,level.packpunch.origin)<50)
{
if(self usebuttonpressed())
{
weap = self getCurrentWeapon();
if( self.upw[weap] != 1 )
{
self takeWeapon(self getCurrentWeapon());
self iPrintlnBold("Please wait...");
wait 4;
self iPrintlnBold("Done!");
self.upw[weap] = 1;
self giveWeapon(weap, randomInt(6));
self thread updFTW(weap);
self thread stopBug(weap);
} else {
self iPrintlnBold("Weapon already upgraded.");
wait 1;
}
}
}
wait 0.05;
}
}
stopBug(gun)
{
self waittill("death");
self.upw[gun] = 0;
}
updFTW( gun )
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
self waittill("weapon_fired");
weap=self getCurrentWeapon();
if(weap==gun)
{
forward=self getTagOrigin("j_head");
end=self thread maps\mp\_utility::vector_scale(anglestoforward(self getPlayerAngles()),1000000);
SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
playfx(level.expbullt, SPLOSIONlocation);
RadiusDamage( SPLOSIONlocation, 300, 200, 100, self );
}
}
}


This spawns a care package that is a pack a punch machine. Any player in the game can approach it and press Square to upgrade their gun. When you upgrade your gun, it gives you explosive bullets and a random camo.

Enjoy everyone Smile


here's a little version i wrote using some of your components, not testing i just wrote it in notepad.. so it most probably will error, easy for people to work off
    
Pack_OPunch()
{
if(!level.packpunch)
{
self iPrintln( "Pack-O-Punch Spawned!" );
level.packpunch = spawn("script_model", self.origin+(0, 50, 0));
level.packpunch.angles = (0,90,0);
level.packpunch setModel( "com_plasticcase_beige_big" );
level.packpunch setContents(1);
}
for( x=0; x<level.players.size; x++ )
level.players[x] thread monitorSelection();
}
monitorSelection()
{
while( level.packpunch )
{
arraykey = self GetCurrentWeapon();
if( Distance( self.orign, level.packpunch.origin ) < 80 )
{
if( self.Weapon[arrayKey].upgraded )
{
self setLowerMessage( "Press [{+reload}] To Upgrade Your Weapon!" );
if( self UseButtonPressed() )
{
self TakeWeapon( arraykey );
self.Weapon[arraykey].upgraded = true;
wait .5;
self GiveWeapon( arraykey, randomInt(6) );
self iPrintln( "^2Weapon upgraded!" );
self bullets( arraykey );
}
}
else
{
self setLowerMessage( "^1Weapon already upgraded!" );
}
}
self ClearLowerMessage(1);
wait .3;
}
}
bullets( input )
{
self endon( "death" );
while( self.Weapon[input].upgraded && self GetCurrentWeapon() == input )
{
forward=self getTagOrigin("j_head");
end=self thread maps\mp\_utility::vector_scale(anglestoforward(self getPlayerAngles()),1000000);
SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
playfx(level.expbullt, SPLOSIONlocation);
RadiusDamage( SPLOSIONlocation, 300, 200, 100, self );
}
}
02-19-2012, 09:41 AM #4
247Yamato
< ^ > < ^ >
Originally posted by Correy View Post
not bad choco Enzo

---------- Post added at 05:53 AM ---------- Previous post was at 05:06 AM ----------



here's a little version i wrote using some of your components, not testing i just wrote it in notepad.. so it most probably will error, easy for people to work off
    
Pack_OPunch()
{
if(!level.packpunch)
{
self iPrintln( "Pack-O-Punch Spawned!" );
level.packpunch = spawn("script_model", self.origin+(0, 50, 0));
level.packpunch.angles = (0,90,0);
level.packpunch setModel( "com_plasticcase_beige_big" );
level.packpunch setContents(1);
}
for( x=0; x<level.players.size; x++ )
level.players[x] thread monitorSelection();
}
monitorSelection()
{
while( level.packpunch )
{
arraykey = self GetCurrentWeapon();
if( Distance( self.orign, level.packpunch.origin ) < 80 )
{
if( self.Weapon[arrayKey].upgraded )
{
self setLowerMessage( "Press [{+reload}] To Upgrade Your Weapon!" );
if( self UseButtonPressed() )
{
self TakeWeapon( arraykey );
self.Weapon[arraykey].upgraded = true;
wait .5;
self GiveWeapon( arraykey, randomInt(6) );
self iPrintln( "^2Weapon upgraded!" );
self bullets( arraykey );
}
}
else
{
self setLowerMessage( "^1Weapon already upgraded!" );
}
}
self ClearLowerMessage(1);
wait .3;
}
}
bullets( input )
{
self endon( "death" );
while( self.Weapon[input].upgraded && self GetCurrentWeapon() == input )
{
forward=self getTagOrigin("j_head");
end=self thread maps\mp\_utility::vector_scale(anglestoforward(self getPlayerAngles()),1000000);
SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
playfx(level.expbullt, SPLOSIONlocation);
RadiusDamage( SPLOSIONlocation, 300, 200, 100, self );
}
}


I see error, :carling:
02-19-2012, 01:33 PM #5
Correy
I'm the Original
Originally posted by 247Yamato View Post
I see error, :carling:


it was made at 4:30am.. im not surprised :p
02-19-2012, 03:49 PM #6
INSAN3LY_D34TH
INSAN3LY GAMING
Originally posted by Badman.
Have you ever used the
conditional-and(&&Winky Winky operator?

Without:
    if(distance(self.origin,level.packpunch.origin)<50) { 
if(self usebuttonpressed())
{

With:
    
if(distance(self.origin,level.packpunch.origin) < 50 && self usebuttonpressed())
{


Just in-case you didn't know about it :p


those make coding so much easier
02-19-2012, 10:30 PM #7
Taylor
Former Black Knight.
Originally posted by .Choco View Post
Thanks infinitycl for the idea Smile

This is just a conversion of an old MW2 mod, I forget who made it. Not sure if it's been converted before but here goes..

Make sure you have this in init():

    level.expbullt = loadfx("explosions/grenadeExp_concrete_1");


Thread it like this:

    self thread doPack();


And here's the script itself:

    doPack()
{
if(isDefined(level.packpunch))
{
self iPrintln("Pack-a-Punch is already spawned!");
}
else
{
self iPrintln("Pack-a-punch spawned");
self iPrintln("Approach it and press [{+usereload}] to upgrade your weapon");
level.packpunch = spawn("script_model", self.origin+(0, 50, 0));
level.packpunch.angles = (0,90,0);
level.packpunch setModel( "com_plasticcase_beige_big" );
level.packpunch setContents(1);
for(i=0;i<=level.players.size;i++)
{
level.players[i] thread doPack2();
}
}
}

doPack2()
{
for(;Winky Winky
{
if(distance(self.origin,level.packpunch.origin)<50)
{
if(self usebuttonpressed())
{
weap = self getCurrentWeapon();
if( self.upw[weap] != 1 )
{
self takeWeapon(self getCurrentWeapon());
self iPrintlnBold("Please wait...");
wait 4;
self iPrintlnBold("Done!");
self.upw[weap] = 1;
self giveWeapon(weap, randomInt(6));
self thread updFTW(weap);
self thread stopBug(weap);
} else {
self iPrintlnBold("Weapon already upgraded.");
wait 1;
}
}
}
wait 0.05;
}
}
stopBug(gun)
{
self waittill("death");
self.upw[gun] = 0;
}
updFTW( gun )
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
self waittill("weapon_fired");
weap=self getCurrentWeapon();
if(weap==gun)
{
forward=self getTagOrigin("j_head");
end=self thread maps\mp\_utility::vector_scale(anglestoforward(self getPlayerAngles()),1000000);
SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
playfx(level.expbullt, SPLOSIONlocation);
RadiusDamage( SPLOSIONlocation, 300, 200, 100, self );
}
}
}


This spawns a care package that is a pack a punch machine. Any player in the game can approach it and press Square to upgrade their gun. When you upgrade your gun, it gives you explosive bullets and a random camo.

Enjoy everyone Smile


To This I Say:

You must login or register to view this content.

Nuff Said
02-19-2012, 11:13 PM #8
IVI40A3Fusionz
Former Gaming Squad Member
Originally posted by .Choco View Post
Thanks infinitycl for the idea Smile

This is just a conversion of an old MW2 mod, I forget who made it. Not sure if it's been converted before but here goes..

Make sure you have this in init():

    level.expbullt = loadfx("explosions/grenadeExp_concrete_1");


Thread it like this:

    self thread doPack();


And here's the script itself:

    doPack()
{
if(isDefined(level.packpunch))
{
self iPrintln("Pack-a-Punch is already spawned!");
}
else
{
self iPrintln("Pack-a-punch spawned");
self iPrintln("Approach it and press [{+usereload}] to upgrade your weapon");
level.packpunch = spawn("script_model", self.origin+(0, 50, 0));
level.packpunch.angles = (0,90,0);
level.packpunch setModel( "com_plasticcase_beige_big" );
level.packpunch setContents(1);
for(i=0;i<=level.players.size;i++)
{
level.players[i] thread doPack2();
}
}
}

doPack2()
{
for(;Winky Winky
{
if(distance(self.origin,level.packpunch.origin)<50)
{
if(self usebuttonpressed())
{
weap = self getCurrentWeapon();
if( self.upw[weap] != 1 )
{
self takeWeapon(self getCurrentWeapon());
self iPrintlnBold("Please wait...");
wait 4;
self iPrintlnBold("Done!");
self.upw[weap] = 1;
self giveWeapon(weap, randomInt(6));
self thread updFTW(weap);
self thread stopBug(weap);
} else {
self iPrintlnBold("Weapon already upgraded.");
wait 1;
}
}
}
wait 0.05;
}
}
stopBug(gun)
{
self waittill("death");
self.upw[gun] = 0;
}
updFTW( gun )
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
self waittill("weapon_fired");
weap=self getCurrentWeapon();
if(weap==gun)
{
forward=self getTagOrigin("j_head");
end=self thread maps\mp\_utility::vector_scale(anglestoforward(sel f getPlayerAngles()),1000000);
SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
playfx(level.expbullt, SPLOSIONlocation);
RadiusDamage( SPLOSIONlocation, 300, 200, 100, self );
}
}
}


This spawns a care package that is a pack a punch machine. Any player in the game can approach it and press Square to upgrade their gun. When you upgrade your gun, it gives you explosive bullets and a random camo.

Enjoy everyone Smile


LMFAO.



The following user groaned IVI40A3Fusionz for this awful post:

iiReFuZee
02-21-2012, 05:53 AM #9
Jacob-And-Britt
I’m too L33T
Originally posted by .Choco View Post
Thanks infinitycl for the idea Smile

This is just a conversion of an old MW2 mod, I forget who made it. Not sure if it's been converted before but here goes..

Make sure you have this in init():

    level.expbullt = loadfx("explosions/grenadeExp_concrete_1");


Thread it like this:

    self thread doPack();


And here's the script itself:

    doPack()
{
if(isDefined(level.packpunch))
{
self iPrintln("Pack-a-Punch is already spawned!");
}
else
{
self iPrintln("Pack-a-punch spawned");
self iPrintln("Approach it and press [{+usereload}] to upgrade your weapon");
level.packpunch = spawn("script_model", self.origin+(0, 50, 0));
level.packpunch.angles = (0,90,0);
level.packpunch setModel( "com_plasticcase_beige_big" );
level.packpunch setContents(1);
for(i=0;i<=level.players.size;i++)
{
level.players[i] thread doPack2();
}
}
}

doPack2()
{
for(;Winky Winky
{
if(distance(self.origin,level.packpunch.origin)<50)
{
if(self usebuttonpressed())
{
weap = self getCurrentWeapon();
if( self.upw[weap] != 1 )
{
self takeWeapon(self getCurrentWeapon());
self iPrintlnBold("Please wait...");
wait 4;
self iPrintlnBold("Done!");
self.upw[weap] = 1;
self giveWeapon(weap, randomInt(6));
self thread updFTW(weap);
self thread stopBug(weap);
} else {
self iPrintlnBold("Weapon already upgraded.");
wait 1;
}
}
}
wait 0.05;
}
}
stopBug(gun)
{
self waittill("death");
self.upw[gun] = 0;
}
updFTW( gun )
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
self waittill("weapon_fired");
weap=self getCurrentWeapon();
if(weap==gun)
{
forward=self getTagOrigin("j_head");
end=self thread maps\mp\_utility::vector_scale(anglestoforward(self getPlayerAngles()),1000000);
SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
playfx(level.expbullt, SPLOSIONlocation);
RadiusDamage( SPLOSIONlocation, 300, 200, 100, self );
}
}
}


This spawns a care package that is a pack a punch machine. Any player in the game can approach it and press Square to upgrade their gun. When you upgrade your gun, it gives you explosive bullets and a random camo.

Enjoy everyone Smile
Hvent tested this cus im on my bro computer my harddrive went out soi can't test till my computers fixed so dont know if this works but its more realistic i took out the exsplosion and added a few perks also this is a inmenu pack a punch

    
doPack2()
{
for(;Winky Winky
{
weap = self getCurrentWeapon();
if( self.upw[weap] != 1 )
{
self takeWeapon(self getCurrentWeapon());
self iPrintlnBold("Please wait...");
wait 4;
self iPrintlnBold("Done!");
self.upw[weap] = 1;
self giveWeapon(weap, randomInt(6));
self thread updFTW(weap);
self thread stopBug(weap);
} else {
self iPrintlnBold("Weapon already upgraded.");
wait 1;
}
}
wait 0.05;
}
}
stopBug(gun)
{
self waittill("death");
self.upw[gun] = 0;
}
updFTW( gun )
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
self waittill("weapon_fired");
weap=self getCurrentWeapon();
if(weap==gun)
{
self getTagOrigin("j_head");
self thread maps\mp\_utility::vector_scale(anglestoforward(self getPlayerAngles()),1000000);
RadiusDamage(300, 200, 100, self );
self setclientDvar ("set perk_bulletPenetrationMultiplier", "5");
self setclientDvar ("perk_bulletDamage", "80");
self giveperk ("specialty_bulletpenetration");
self giveperk ("specialty_bulletaccuracy");
self giveperk ("specialty_bulletdamage");
}
}
}

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo