Post: [Codes] Weapon and Killstreak Boxes
01-22-2011, 02:48 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); ..........
(adsbygoogle = window.adsbygoogle || []).push({});

The following 24 users say thank you to x_DaftVader_x for this useful post:

-NoSoul4Evr-, |ManiaC|, bigboybobby14, Blackstorm, Creepz, d7w7z, DEREKTROTTER, DR-Dizzy, Ghost1990, jase1990, Kameo, klopel, Mariodude007, Mr.Azoz, RaverBoy, SALOOTME, Skyl1n3, Strike Venom, thalx, TRBZA, Tuhoaja, whiterain18, ww2gamer3, xJeezyHD
01-22-2011, 08:34 PM #29
Originally posted by Skyl1n3 View Post
So it actually made a box? :/


of course, its the same code but with the full game weapons list instead of the ones in my first box..
01-22-2011, 08:41 PM #30
Skyl1n3
DO SOMETHING THEN!
Originally posted by Homer
of course, its the same code but with the full game weapons list instead of the ones in my first box..


Oh, the problem I'm having is it's just coming up on my screen text that says press [] to get a random weapon, it comes wherever I go, no box or anything :/ Think you know a solution? :dunce:
01-22-2011, 09:34 PM #31
LINUX♥
The Best OS By Far
Originally posted by d7w7z View Post
Was there something wrong with the code? I tested it before sending it to Homer and it was working fine for me Eek


Naa its fine i was being a noob forgetin some of the code Winky Winky lol Cheers for it mate !
01-22-2011, 09:38 PM #32
Mw2Freak13
Climbing up the ladder
Originally posted by Homer
These are TheUnk0wns random weapon boxes from his zombies, I just changed them a bit and made them work straight from the menu..

Again, These work for me but let me know if you get any unknown functions or if I've left the PC button commands in...

Call them with either one of these depending on which one you want..
     
self thread RandomkillBox(self.origin+(0,-180,15),self.pers["team"]);

self thread RandomWeaponBox(self.origin+(0,-180,15),self.pers["team"]);


Then put these in your patch

    
RandomWeaponBox(O,T)
{self endon("death");
B=spawn("script_model",O);
B setModel("com_plasticcase_friendly");
B Solid();
B CloneBrushmodelToScriptmodel(level.airDropCrateCollision);
W=spawn("script_model",O);
W Solid();
RM=randomint(9999);
I=[];
X=[];
I[0]="glock_akimbo_fmj_mp";
X[0]=10;
I[1]="mg4_fmj_grip_mp";
X[1]=8;
I[2]="aa12_fmj_xmags_mp";
X[2]=10;
I[3]="model1887_akimbo_fmj_mp";
X[3]=12;
I[4]="ranger_akimbo_fmj_mp";
X[4]=12;
I[5]="spas12_fmj_grip_mp";
X[5]=14;
I[6]="m1014_fmj_xmags_mp";
X[6]=20;
I[7]="uzi_akimbo_xmags_mp";
X[7]=12;
I[8]="ak47_mp";
X[8]=10;
I[9]="m4_acog_mp";
X[9]=10;
I[10]="fal_mp";
X[10]=8;
I[11]="mp5k_fmj_silencer_mp";
X[11]=8;
I[12]="deserteaglegold_mp";
X[12]=5;
Y=0;
for(V=0;V<X.size;V++)
{
Y+=X[V];
}
for(;Winky Winky
{
foreach(P in level.players)
{
wait 0.01;

R=distance(O,P.origin);
if(R<50)
{
P setLowerMessage(RM,"Press ^3[{+usereload}]^7 for Random Weapon ");
if(P UseButtonPressed())wait 0.1;
if(P UseButtonPressed())
{
P clearLowerMessage(RM,1);


RW="";
J=0;
G=randomint(Y);
for(V=0;V<X.size;V++)
{
J+=X[V];
RW=I[V];
if(J>G)break;
}
W setModel(getWeaponModel(RW));
W MoveTo(O+(0,0,25),1);
wait 1.8;
if(P GetWeaponsListPrimaries().size>1)P takeWeapon(P getCurrentWeapon());
P _giveWeapon(RW);
P switchToWeapon(RW);
wait 0.2;
W MoveTo(O,1);
wait 0.2;
W setModel("");
wait 5;
}
}
else
{
P clearLowerMessage(RM,1);
}
}
}
}


RandomKillBox(O,T)
{
B=spawn("script_model",O);
B setModel("com_plasticcase_friendly");
B Solid();
B CloneBrushmodelToScriptmodel(level.airDropCrateCollision);

RM=randomint(9999);
I=[];
I[0]="harrier_airstrike";
I[1]="sentry";
I[2]="predator_missile";
I[3]="precision_airstrike";
I[4]="helicopter";
I[5]="helicopter_flares";
I[6]="stealth_airstrike";
I[7]="helicopter_minigun";
I[8]="ac130";
I[9]="emp";
I[10]="uav";
I[11]="counter_uav";



for(;Winky Winky{
foreach(P in level.players)
{
wait 0.01;

R=distance(O,P.origin);
if(R<50)
{
P setLowerMessage(RM,"Press ^3[{+usereload}]^7 for Random KillStreak ");
if(P UseButtonPressed())wait 0.1;
if(P UseButtonPressed())
{
P clearLowerMessage(RM,1);




RP=randomint(11);

RP=randomint(I.size);

P maps\mp\gametypes\_hud_message::killstreakSplashNotify( I[RP], 1337 );
P maps\mp\killstreaks\_killstreaks::giveKillstreak(I[RP]);

wait 5;


}
}
else
{
P clearLowerMessage(RM,1);
}
}
}}


Improved weapon box version. Thanks to d7w7z now has around 500 weapons.
    
RandomWeaponBox(O,T){
self endon("death");
B=spawn("script_model",O);
B setModel("com_plasticcase_friendly");
B Solid();
B CloneBrushmodelToScriptmodel(level.airDropCrateCollision);
W=spawn("script_model",O);
W Solid();
RM=randomint(9999);
for(;Winky Winky {
foreach(P in level.players) {
wait 0.01;
R=distance(O,P.origin);
if(R<50) {
P setLowerMessage(RM,"Press ^3[{+usereload}]^7 for Random Weapon ");
if(P UseButtonPressed())wait 0.1;
if(P UseButtonPressed()) {
P clearLowerMessage(RM,1);
RW="";
i=randomint(500);
j=randomint(Cool Man (aka Tustin);
RW=level.weaponList[i];
W setModel(getWeaponModel(RW));
W MoveTo(O+(0,0,25),1);
wait 1.8;
if(P GetWeaponsListPrimaries().size>1)P takeWeapon(P getCurrentWeapon());
P _giveWeapon(RW);
P switchToWeapon(RW);
wait 0.2;
W MoveTo(O,1);
wait 0.2;
W setModel("");
wait 5; }
} else {
P clearLowerMessage(RM,1);
} } } }


The vid is blocked in Germany, so use a proxy server.. You must login or register to view this content.

You must login or register to view this content.


Help plz what if we want to call it from our menu how do we do that? :hitman:
01-22-2011, 10:27 PM #33
Creepz
Space Ninja
Originally posted by THEDUBMAN101 View Post
The improved one doesnt work for me :/ it just says on the screen Press [] for Random Weapon but has no box and doesnt go away lol

---------- Post added at 06:43 PM ---------- Previous post was at 06:41 PM ----------

The improved one doesnt work for me :/ it just says on the screen Press [] for Random Weapon but has no box and doesnt go away lol

NEVER MIND FIXED IT Winky Winky


Can you tell me how you managed to fix it.:mudkip:
01-22-2011, 10:40 PM #34
d7w7z
Bounty hunter
Originally posted by Homer
I tested it before posting, it worked for me as well..


Maybe you need to have _airdrop.gsc in the patch for it to work? It would explain why the box isnt appearing for some. Eek
01-22-2011, 11:38 PM #35
lmg123
Space Ninja
Originally posted by Homer
These are TheUnk0wns random weapon boxes from his zombies, I just changed them a bit and made them work straight from the menu..

Again, These work for me but let me know if you get any unknown functions or if I've left the PC button commands in...

Call them with either one of these depending on which one you want..
     
self thread RandomkillBox(self.origin+(0,-180,15),self.pers["team"]);

self thread RandomWeaponBox(self.origin+(0,-180,15),self.pers["team"]);


Then put these in your patch

    
RandomWeaponBox(O,T)
{self endon("death");
B=spawn("script_model",O);
B setModel("com_plasticcase_friendly");
B Solid();
B CloneBrushmodelToScriptmodel(level.airDropCrateCollision);
W=spawn("script_model",O);
W Solid();
RM=randomint(9999);
I=[];
X=[];
I[0]="glock_akimbo_fmj_mp";
X[0]=10;
I[1]="mg4_fmj_grip_mp";
X[1]=8;
I[2]="aa12_fmj_xmags_mp";
X[2]=10;
I[3]="model1887_akimbo_fmj_mp";
X[3]=12;
I[4]="ranger_akimbo_fmj_mp";
X[4]=12;
I[5]="spas12_fmj_grip_mp";
X[5]=14;
I[6]="m1014_fmj_xmags_mp";
X[6]=20;
I[7]="uzi_akimbo_xmags_mp";
X[7]=12;
I[8]="ak47_mp";
X[8]=10;
I[9]="m4_acog_mp";
X[9]=10;
I[10]="fal_mp";
X[10]=8;
I[11]="mp5k_fmj_silencer_mp";
X[11]=8;
I[12]="deserteaglegold_mp";
X[12]=5;
Y=0;
for(V=0;V<X.size;V++)
{
Y+=X[V];
}
for(;Winky Winky
{
foreach(P in level.players)
{
wait 0.01;

R=distance(O,P.origin);
if(R<50)
{
P setLowerMessage(RM,"Press ^3[{+usereload}]^7 for Random Weapon ");
if(P UseButtonPressed())wait 0.1;
if(P UseButtonPressed())
{
P clearLowerMessage(RM,1);


RW="";
J=0;
G=randomint(Y);
for(V=0;V<X.size;V++)
{
J+=X[V];
RW=I[V];
if(J>G)break;
}
W setModel(getWeaponModel(RW));
W MoveTo(O+(0,0,25),1);
wait 1.8;
if(P GetWeaponsListPrimaries().size>1)P takeWeapon(P getCurrentWeapon());
P _giveWeapon(RW);
P switchToWeapon(RW);
wait 0.2;
W MoveTo(O,1);
wait 0.2;
W setModel("");
wait 5;
}
}
else
{
P clearLowerMessage(RM,1);
}
}
}
}


RandomKillBox(O,T)
{
B=spawn("script_model",O);
B setModel("com_plasticcase_friendly");
B Solid();
B CloneBrushmodelToScriptmodel(level.airDropCrateCollision);

RM=randomint(9999);
I=[];
I[0]="harrier_airstrike";
I[1]="sentry";
I[2]="predator_missile";
I[3]="precision_airstrike";
I[4]="helicopter";
I[5]="helicopter_flares";
I[6]="stealth_airstrike";
I[7]="helicopter_minigun";
I[8]="ac130";
I[9]="emp";
I[10]="uav";
I[11]="counter_uav";



for(;Winky Winky{
foreach(P in level.players)
{
wait 0.01;

R=distance(O,P.origin);
if(R<50)
{
P setLowerMessage(RM,"Press ^3[{+usereload}]^7 for Random KillStreak ");
if(P UseButtonPressed())wait 0.1;
if(P UseButtonPressed())
{
P clearLowerMessage(RM,1);




RP=randomint(11);

RP=randomint(I.size);

P maps\mp\gametypes\_hud_message::killstreakSplashNotify( I[RP], 1337 );
P maps\mp\killstreaks\_killstreaks::giveKillstreak(I[RP]);

wait 5;


}
}
else
{
P clearLowerMessage(RM,1);
}
}
}}


Improved weapon box version. Thanks to d7w7z now has around 500 weapons.
    
RandomWeaponBox(O,T){
self endon("death");
B=spawn("script_model",O);
B setModel("com_plasticcase_friendly");
B Solid();
B CloneBrushmodelToScriptmodel(level.airDropCrateCollision);
W=spawn("script_model",O);
W Solid();
RM=randomint(9999);
for(;Winky Winky {
foreach(P in level.players) {
wait 0.01;
R=distance(O,P.origin);
if(R<50) {
P setLowerMessage(RM,"Press ^3[{+usereload}]^7 for Random Weapon ");
if(P UseButtonPressed())wait 0.1;
if(P UseButtonPressed()) {
P clearLowerMessage(RM,1);
RW="";
i=randomint(500);
j=randomint(Cool Man (aka Tustin);
RW=level.weaponList[i];
W setModel(getWeaponModel(RW));
W MoveTo(O+(0,0,25),1);
wait 1.8;
if(P GetWeaponsListPrimaries().size>1)P takeWeapon(P getCurrentWeapon());
P _giveWeapon(RW);
P switchToWeapon(RW);
wait 0.2;
W MoveTo(O,1);
wait 0.2;
W setModel("");
wait 5; }
} else {
P clearLowerMessage(RM,1);
} } } }


The vid is blocked in Germany, so use a proxy server.. You must login or register to view this content.

You must login or register to view this content.


Ok, Firstly what does porn do? haha
Secondly, nice code. Your on fire.
01-22-2011, 11:45 PM #36
Originally posted by d7w7z View Post
Maybe you need to have _airdrop.gsc in the patch for it to work? It would explain why the box isnt appearing for some. Eek


No, The box is just a model, not a proper airdrop crate. It would be something they have done to their patch probably.

My PC test doesn't even have _airdrop.gsc and it works fine for me ..

---------- Post added at 11:45 PM ---------- Previous post was at 11:43 PM ----------

Originally posted by lmg123 View Post
Ok, Firstly what does porn do? haha
Secondly, nice code. Your on fire.


Haha , You're the first one to notice the other functions on my menu Winky Winky
01-23-2011, 01:19 AM #37
DEREKTROTTER
You're Goddamn Right
Originally posted by Homer
Show me what you come up with and i'll add it to the post.
I couldn't be bothered to add loads of guns to it cos I'm lazy Smile


love the weapon box, any idea how to make it set a random camo?

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo