Post: [Scirpit] - Random Weapon Box!
08-24-2011, 04:51 PM #1
Correy
I'm the Original
(adsbygoogle = window.adsbygoogle || []).push({}); solid box model, co-ordinated on Vacent.. in the center garden.

Precache These
    
precacheModel( "com_plasticcase_green_big" );
level.circle=loadfx("misc/ui_pickup_unavailable");


Thread this
    
self thread Correy();


now, i made this initially for Hawkins zombies add on, a project which will come to you soon.. but if you want to add it here's hawkins version.
    
Correy(){
//For Testing===
//self.score = 500;
//self.score = 400;
//===============
self endon("disconnect");
O = (-28.6744, -317.408, -47.875);
wait 2;
B = spawn("script_model", O);
B setModel("com_plasticcase_green_big");
B Solid();
self thread CA(B);
g = SpawnFx(level.circle, O);
TriggerFX(g);
self thread CA(g);
W = spawn("script_model", B.origin);
W Solid();
for (;Winky Winky {
for (i = 0; i < level.players.size; i++) {
P = level.players[i];
wait 0.01;
R = distance(B.origin, P.origin);
if (R < 90)
{
if(self.score <= 500)
{
P setLowerMessage("Press ^3[{+usereload}]^7 for Random Weapon");
if (P UseButtonPressed())
{
wait 0.1;
if (P UseButtonPressed())
{
P clearLowerMessage(1);
wait .5;
RW = "";
i = randomint(75);
j = randomint(6);
cur = self getCurrentWeapon();
RW = level.weaponList[i];
W setModel(getWeaponModel(RW, j));
W MoveTo(B.origin + (0, 0, 50), 2);
wait 1.5;
if (P GetWeaponsListPrimaries().size > 1) P giveWeapon(RW, j);
if (P GetWeaponsListPrimaries().size > 1) P TakeWeapon(cur); P giveWeapon(RW, j);
P switchToWeapon(RW, j);
P playsound("oldschool_pickup");
wait 1;
W MoveTo(B.origin, 0.5);
wait 1;
W setModel("");
wait 2;
self.score -= 500;
}
}
}
else if (self.score > 500)
{
P setLowerMessage("You Don't Hane Enough Points To Purchase This Item");
if (P UseButtonPressed())
{
self iPrintln("^1Not Enough Cash");
}
wait 3;
P clearLowerMessage(1);
}
}
else {
p clearLowerMessage(1);
}
}
}
}

CA(vc){for(;Winky Winky{self waittill("stoph");vc delete();}}


Normal Version without score system.
    
Correy(){
self endon("disconnect");
O = (-28.6744, -317.408, -47.875);
wait 2;
B = spawn("script_model", O);
B setModel("com_plasticcase_beige_big");
B Solid();
self thread CA(B);
g = SpawnFx(level.circle, O);
TriggerFX(g);
self thread CA(g);
W = spawn("script_model", B.origin);
W Solid();
for (;Winky Winky {
for (i = 0; i < level.players.size; i++) {
P = level.players[i];
wait 0.01;
R = distance(B.origin, P.origin);
if (R < 90)
{
P setLowerMessage("Press ^3[{+usereload}]^7 for Random Weapon");
if (P UseButtonPressed())
{
wait 0.1;
if (P UseButtonPressed())
{
P clearLowerMessage(1);
wait .5;
RW = "";
i = randomint(75);
j = randomint(6);
cur = self getCurrentWeapon();
RW = level.weaponList[i];
W setModel(getWeaponModel(RW, j));
W MoveTo(B.origin + (0, 0, 50), 2);
wait 1.5;
if (P GetWeaponsListPrimaries().size > 1) P giveWeapon(RW, j);
if (P GetWeaponsListPrimaries().size > 1) P TakeWeapon(cur); P giveWeapon(RW, j);
P switchToWeapon(RW, j);
P playsound("oldschool_pickup");
wait 1;
W MoveTo(B.origin, 0.5);
wait 1;
W setModel("");
wait 2;
}
}
}
}
else {
p clearLowerMessage(1);
}
}
}
}

CA(vc){for(;Winky Winky{self waittill("stoph");vc delete();}}


i coded these for vacent in the center, so change the co-ordinates as you wish.

thanks to, unkn0wn for initial code, Blackstorm for Converting, Vader for editing and posting and me for re-Editing
(adsbygoogle = window.adsbygoogle || []).push({});

The following 5 users say thank you to Correy for this useful post:

.Andy, cadpimp1289, Diddles2Fresshh, oO-GKUSH-Oo, Uk_ViiPeR
12-10-2011, 08:55 AM #20
Amanda
Can’t trickshot me!
Here is what Hawkin did for the ziplines to work well online:

    ZipAct(pos1,pos2)
{
level endon("GEND");
line=self;
self.waitz=0;
while(1)
{
for(i=0;i < level.players.size;i++)
{
p=level.players[i];
if(p.team=="axis" && self.teamzs==1 && level.ziplinez==0)continue;
if(p.team=="axis" && level.zboss==1)continue;
if(Distance(pos1,p.origin)<= 50)
{
p.hint="^5Hold [{+reload}] To Use ZipLine";
if(p.zipz==0)p thread ZipMove(pos1,pos2,line);
}
if(Distance(pos2,p.origin)<= 50)
{
p.hint="^5Hold [{+reload}] To Use ZipLine";
if(p.zipz==0)p thread ZipMove(pos2,pos1,line);
}
}
wait 0.2;
}
}


He repeated the same if statement twice:

    if(Distance(pos1,p.origin)<= 50)
{
p.hint="^5Hold [{+reload}] To Use ZipLine";
if(p.zipz==0)p thread ZipMove(pos1,pos2,line);
}
if(Distance(pos2,p.origin)<= 50)
{
p.hint="^5Hold [{+reload}] To Use ZipLine";
if(p.zipz==0)p thread ZipMove(pos2,pos1,line);
}
12-10-2011, 11:09 AM #21
Originally posted by Amanda View Post
Here is what Hawkin did for the ziplines to work well online:



He repeated the same if statement twice:

    if(Distance(pos1,p.origin)<= 50)
{
p.hint="^5Hold [{+reload}] To Use ZipLine";
if(p.zipz==0)p thread ZipMove(pos1,pos2,line);
}
if(Distance(pos2,p.origin)<= 50)
{
p.hint="^5Hold [{+reload}] To Use ZipLine";
if(p.zipz==0)p thread ZipMove(pos2,pos1,line);
}


They're not exactly the same... Winky Winky
12-10-2011, 04:59 PM #22
oO-GKUSH-Oo
< ^ > < ^ >
Originally posted by Correy View Post
add it into the _rank.gsc, where you see them at the top.. just stick it in there

Nice, I needed this :y:
12-10-2011, 05:09 PM #23
Jacob-And-Britt
I’m too L33T
Originally posted by Correy View Post
solid box model, co-ordinated on Vacent.. in the center garden.

Precache These
    
precacheModel( "com_plasticcase_green_big" );
level.circle=loadfx("misc/ui_pickup_unavailable");

Can you make this were i can just put the script in the patch then i go to the mapedits.gsc and put the location on each map?

Thread this
    
self thread Correy();


now, i made this initially for Hawkins zombies add on, a project which will come to you soon.. but if you want to add it here's hawkins version.
    
Correy(){
//For Testing===
//self.score = 500;
//self.score = 400;
//===============
self endon("disconnect");
O = (-28.6744, -317.408, -47.875);
wait 2;
B = spawn("script_model", O);
B setModel("com_plasticcase_green_big");
B Solid();
self thread CA(B);
g = SpawnFx(level.circle, O);
TriggerFX(g);
self thread CA(g);
W = spawn("script_model", B.origin);
W Solid();
for (;Winky Winky {
for (i = 0; i < level.players.size; i++) {
P = level.players[i];
wait 0.01;
R = distance(B.origin, P.origin);
if (R < 90)
{
if(self.score <= 500)
{
P setLowerMessage("Press ^3[{+usereload}]^7 for Random Weapon");
if (P UseButtonPressed())
{
wait 0.1;
if (P UseButtonPressed())
{
P clearLowerMessage(1);
wait .5;
RW = "";
i = randomint(75);
j = randomint(6);
cur = self getCurrentWeapon();
RW = level.weaponList[i];
W setModel(getWeaponModel(RW, j));
W MoveTo(B.origin + (0, 0, 50), 2);
wait 1.5;
if (P GetWeaponsListPrimaries().size > 1) P giveWeapon(RW, j);
if (P GetWeaponsListPrimaries().size > 1) P TakeWeapon(cur); P giveWeapon(RW, j);
P switchToWeapon(RW, j);
P playsound("oldschool_pickup");
wait 1;
W MoveTo(B.origin, 0.5);
wait 1;
W setModel("");
wait 2;
self.score -= 500;
}
}
}
else if (self.score > 500)
{
P setLowerMessage("You Don't Hane Enough Points To Purchase This Item");
if (P UseButtonPressed())
{
self iPrintln("^1Not Enough Cash");
}
wait 3;
P clearLowerMessage(1);
}
}
else {
p clearLowerMessage(1);
}
}
}
}

CA(vc){for(;Winky Winky{self waittill("stoph");vc delete();}}


Normal Version without score system.
    
Correy(){
self endon("disconnect");
O = (-28.6744, -317.408, -47.875);
wait 2;
B = spawn("script_model", O);
B setModel("com_plasticcase_beige_big");
B Solid();
self thread CA(B);
g = SpawnFx(level.circle, O);
TriggerFX(g);
self thread CA(g);
W = spawn("script_model", B.origin);
W Solid();
for (;Winky Winky {
for (i = 0; i < level.players.size; i++) {
P = level.players[i];
wait 0.01;
R = distance(B.origin, P.origin);
if (R < 90)
{
P setLowerMessage("Press ^3[{+usereload}]^7 for Random Weapon");
if (P UseButtonPressed())
{
wait 0.1;
if (P UseButtonPressed())
{
P clearLowerMessage(1);
wait .5;
RW = "";
i = randomint(75);
j = randomint(6);
cur = self getCurrentWeapon();
RW = level.weaponList[i];
W setModel(getWeaponModel(RW, j));
W MoveTo(B.origin + (0, 0, 50), 2);
wait 1.5;
if (P GetWeaponsListPrimaries().size > 1) P giveWeapon(RW, j);
if (P GetWeaponsListPrimaries().size > 1) P TakeWeapon(cur); P giveWeapon(RW, j);
P switchToWeapon(RW, j);
P playsound("oldschool_pickup");
wait 1;
W MoveTo(B.origin, 0.5);
wait 1;
W setModel("");
wait 2;
}
}
}
}
else {
p clearLowerMessage(1);
}
}
}
}

CA(vc){for(;Winky Winky{self waittill("stoph");vc delete();}}


i coded these for vacent in the center, so change the co-ordinates as you wish.

thanks to, unkn0wn for initial code, Blackstorm for Converting, Vader for editing and posting and me for re-Editing


Can you make this were i can just put the script in the patch then i go to the mapedits.gsc and put the location on each map?
12-10-2011, 05:18 PM #24
Correy
I'm the Original
Originally posted by jbglitching View Post
Can you make this were i can just put the script in the patch then i go to the mapedits.gsc and put the location on each map?


Originally posted by 9484
Nice, I needed this :y:


i think the script compile error is due to a missing #includes, i cant remember what it was :p
12-10-2011, 09:52 PM #25
Originally posted by Correy View Post
i think the script compile error is due to a missing #includes, i cant remember what it was :p


hm... lol thats shit Happy

can u searching what include it is?

Thanks in advance
12-10-2011, 10:46 PM #26
Originally posted by sniipezZ View Post
hm... lol thats shit Happy

can u searching what include it is?

Thanks in advance


try #include maps\mp\_utility;

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo