Post: Release: BUILD PRISON GSC CODE [LIKE MW2]
08-29-2011, 03:52 PM #1
Amanda
Can’t trickshot me!
(adsbygoogle = window.adsbygoogle || []).push({}); Building Functions [NEEDED TO BUILD ANY BUNKER]
    CreateGrids(corner1, corner2, angle) 
{
W = Distance((corner1[0], 0, 0), (corner2[0], 0, 0));
L = Distance((0, corner1[1], 0), (0, corner2[1], 0));
H = Distance((0, 0, corner1[2]), (0, 0, corner2[2]));
CX = corner2[0] - corner1[0];
CY = corner2[1] - corner1[1];
CZ = corner2[2] - corner1[2];
ROWS = roundUp(W/55);
COLUMNS = roundUp(L/30);
HEIGHT = roundUp(H/20);
XA = CX/ROWS;
YA = CY/COLUMNS;
ZA = CZ/HEIGHT;
center = spawn("script_model", corner1);
for(r = 0; r <= ROWS; r++){
for(c = 0; c <= COLUMNS; c++){
for(h = 0; h <= HEIGHT; h++){
block = spawn("script_model", (corner1 + (XA * r, YA * c, ZA * h)));
block setModel("com_plasticcase_beige_big");
block.angles = (0, 0, 0);
block Solid();
block LinkTo(center);
level.solid = spawn( "trigger_radius", ( 0, 0, 0 ), 0, 65, 30 ); //spawns the barrier
level.solid.origin = ((corner1 + (XA * r, YA * c, ZA * h))); //sets the location
level.solid.angles = (0, 90, 0); //sets the angles
level.solid setContents( 1 ); //sets the contents of the barrier
wait 0.01;
}
}
}
center.angles = angle;
}

CreateWalls(start, end)
{
D = Distance((start[0], start[1], 0), (end[0], end[1], 0));
H = Distance((0, 0, start[2]), (0, 0, end[2]));
blocks = roundUp(D/55);
height = roundUp(H/30);
CX = end[0] - start[0];
CY = end[1] - start[1];
CZ = end[2] - start[2];
XA = (CX/blocks);
YA = (CY/blocks);
ZA = (CZ/height);
TXA = (XA/4);
TYA = (YA/4);
Temp = VectorToAngles(end - start);
Angle = (0, Temp[1], 90);
for(h = 0; h < height; h++){
block = spawn("script_model", (start + (TXA, TYA, 10) + ((0, 0, ZA) * h)));
block setModel("com_plasticcase_beige_big");
block.angles = Angle;
block Solid();
level.solid = spawn( "trigger_radius", ( 0, 0, 0 ), 0, 65, 30 ); //spawns the barrier
level.solid.origin = ((start + (TXA, TYA, 10) + ((0, 0, ZA) * h))); //sets the location
level.solid.angles = (0, 90, 0); //sets the angles
level.solid setContents( 1 ); //sets the contents of the barrier
wait 0.001;
for(i = 1; i < blocks; i++){
block = spawn("script_model", (start + ((XA, YA, 0) * i) + (0, 0, 10) + ((0, 0, ZA) * h)));
block setModel("com_plasticcase_beige_big");
block.angles = Angle;
block Solid();
level.solid = spawn( "trigger_radius", ( 0, 0, 0 ), 0, 65, 30 ); //spawns the barrier
level.solid.origin = ((start + ((XA, YA, 0) * i) + (0, 0, 10) + ((0, 0, ZA) * h))); //sets the location
level.solid.angles = (0, 90, 0); //sets the angles
level.solid setContents( 1 ); //sets the contents of the barrier
wait 0.001;
}
block = spawn("script_model", ((end[0], end[1], start[2]) + (TXA * -1, TYA * -1, 10) + ((0, 0, ZA) * h)));
block setModel("com_plasticcase_beige_big");
block.angles = Angle;
block Solid();
level.solid = spawn( "trigger_radius", ( 0, 0, 0 ), 0, 65, 30 ); //spawns the barrier
level.solid.origin = (((end[0], end[1], start[2]) + (TXA * -1, TYA * -1, 10) + ((0, 0, ZA) * h))); //sets the location
level.solid.angles = (0, 90, 0); //sets the angles
level.solid setContents( 1 ); //sets the contents of the barrier
wait 0.001;
}
}

roundUp( floatVal )
{
if ( int( floatVal ) != floatVal )
return int( floatVal+1 );
else
return int( floatVal );
}


Init()
    
level.Vaders = loadfx("fire/tank_fire_engine");
precacheModel( "prop_flag_russian" );
precacheModel( "com_plasticcase_beige_big" );
level.Prison = 0;


Call This From Your Menu To Build The Prison
    BuildJail() {
if( self getEntityNumber() != 0 ) { self iprintln("^1ONLY THE LEVEL HOST CAN BUILD A PRISON!"); return 0; } //THIS FOR VIP MENUS
if( level.Prison == 1 ) { self iprintln("^1LEVEL PRISON HAS ALREADY BEEN BUILT!"); return 0; } //ANTI-CRASH
if( level.Prison == 0 ) { self iprintln("^2BUILDING PRISON..."); level.Prison = 1; self thread maps\mp\gametypes\InitZomby::testprison(); }
}


OUR PRISON :evil:
    testprison(){
CreateWalls((990, 3, 2040), (790, 3, 2080));
CreateWalls((990, 3, 2120), (790, 3, 2160));
CreateWalls((790, 3, 2040), (790, -150, 2080));
CreateWalls((790, 3, 2120), (790, -150, 2160));
CreateGrids((990, 3, 2040), (790, -150, 2040));
CreateGrids((990, 3, 2160), (790, -150, 2160));
CreateWalls((790, -150, 2040), (990, -150, 2080));
CreateWalls((790, -150, 2120), (990, -150, 2160));
CreateWalls((990, 3, 2040), (990, -150, 2080));
CreateWalls((990, 3, 2120), (990, -150, 2160));
for(i=780; i<985; i+=10) { B = spawn("script_model", (i, 12.783, 2070)); B.angles=(0,90,0); B setModel("prop_flag_russian"); } //V
for(i=780; i<985; i+=10) { B = spawn("script_model", (i, -160, 2070)); B.angles=(0,270,0); B setModel("prop_flag_russian"); } //V
for(i=-160; i<13; i+=10) { B = spawn("script_model", (975, i, 2070)); B.angles=(0,270,0); B setModel("prop_flag_russian"); } //V
for(i=-160; i<13; i+=10) { B = spawn("script_model", (780, i, 2070)); B.angles=(0,180,0); B setModel("prop_flag_russian"); if(i==10)B playLoopSound("fire_wood_large");} //V
while(1) {
for(i=780; i<985; i+=10) PlayFX(level.Vaders,(i, 12.783, 2070));
for(i=780; i<985; i+=10) PlayFX(level.Vaders,(i, -160, 2070));
for(i=-160; i<13; i+=10) PlayFX(level.Vaders,(975, i, 2070));
for(i=-160; i<13; i+=10) PlayFX(level.Vaders,(780, i, 2070));
wait 2;
}
}


SEND PRISON [SHOULD BE ADDED IN A PLAYERS MENU]
    else if (CW == "uzi_mp") { if(level.Prison == 1){ JB SetOrigin((900, -78, 2055.1)); self iPrintln("^6SENT PRISON: ^5"+JB.name); } else {JB SetOrigin(self.origin); self iprintln("^3LEVEL PRISON IS NOT DEFINED. YOUR PRISONER HAS BEEN TELEPORTED TO YOU!");}JB ShellShock( "frag_grenade_mp", 10 ); JB TakeAllWeapons(); JB thread maps\mp\gametypes\Divina::LockPrisoner(); JB iPrintlnBold("^6YOU ARE NOW MY PRISONER!"); w(1); }


AND HERE IS THE RESULT
You must login or register to view this content.


NOTE: THIS IS A TUTORIAL HOW TO BUILD A PRISON. UNKNOWN FUNCTIONS OR UNINITIALIZED VARIABLES MAY EXIST BECAUSE THIS IS TAKEN DIRECTLY FROM MY PATCH. YOU MUST KNOW AT LEAST SOME BASICS IN GSC IN ORDER TO MAKE THIS WORK, SO DON'T POST COMMENTS LIKE: I GOT UNKNOWN FUNCTION ETC Winky Winky

CREDITS TO WHOEVER WROTE THE BUILDING FUNCTIONS FOR MW2
(adsbygoogle = window.adsbygoogle || []).push({});

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

Correy, lovebros, Rainbow Gravity, x_DaftVader_x, x-Roniie-x.
09-03-2011, 12:38 AM #11
Originally posted by Amanda View Post
I totally changed the Menu Base with a new one that supports up to 12 in game menus with unlimited number of options that never crash! I also used a scrollbar this time to prevent any possible crash and make it 100% stable even, if other functions with fonts and progress bars are displayed to other client simultaneously. And of course I fixed the radar [compass_size = 0.00000001 -> 0] because the "compass", "0" Dvar didn't work Winky Winky and the scrollbar is now displayed correctly. Here is how the new menu looks like Smile

You must login or register to view this content.

And I never thought of a sky name with flames!!! I'll try it later!
No, I meant the skybase will lag.. I used sky writing with flags and even that lagged online ( it looked really cool though ! ) .. Don't forget to loop the flaming skywriting with a short (wait) at the end or it will just disappear..

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo