Post: Question and i know i in wrong Section!! So What!!
02-06-2011, 05:27 AM #1
Da Only OG
Trollin Since '09
(adsbygoogle = window.adsbygoogle || []).push({}); how would i fix unintisalised variable "maps" when i just added menu.funcs[20]=maps/mp/Chromez::Karachi;?
(adsbygoogle = window.adsbygoogle || []).push({});
02-06-2011, 06:11 AM #11
Da Only OG
Trollin Since '09
Originally posted by Chrome
May I see your karachi code?


karachi(){ CreateWalls((-4573,1780,0),(-4304,1780,150)); CreateElevator((-608,1766,96),(-2599,2011,0)); CreateWalls((-4604,1787,0),(-4606,2102,150)); CreateWalls((-4598,2131,0),(-4297,2155,150)); CreateBlocks((-567,1834,45),(0,-168,0)); CreateWalls((-4291,2125,0),(-4286,1989,146)); CreateDoors((-4274,1892,0),(-4277,1983,0),(90,0,180),6,2,10,100); CreateRamps((-4576,2102,140),(-4380,2117,0)); CreateGrids((-4575,2054,145),(-4303,1810,145)); CreateWalls((-4282,1793,159),(-4284,2071,165)); CreateRamps((-4737,1945,263),(-4620,1948,144)); CreateRamps((-4768,1675,425),(-4756,1904,263)); CreateRamps((-4521,1625,56Cool Man (aka Tustin),(-4767,1655,425)); CreateGrids((-4516,1471,566),(-4283,1773,566)); CreateWalls((-4256,1789,580),(-4254,1454,58Cool Man (aka Tustin));}
02-06-2011, 06:14 AM #12
Chrome Playa
Chrome Gaming Reloaded
Originally posted by Da
karachi(){ CreateWalls((-4573,1780,0),(-4304,1780,150)); CreateElevator((-608,1766,96),(-2599,2011,0)); CreateWalls((-4604,1787,0),(-4606,2102,150)); CreateWalls((-4598,2131,0),(-4297,2155,150)); CreateBlocks((-567,1834,45),(0,-168,0)); CreateWalls((-4291,2125,0),(-4286,1989,146)); CreateDoors((-4274,1892,0),(-4277,1983,0),(90,0,180),6,2,10,100); CreateRamps((-4576,2102,140),(-4380,2117,0)); CreateGrids((-4575,2054,145),(-4303,1810,145)); CreateWalls((-4282,1793,159),(-4284,2071,165)); CreateRamps((-4737,1945,263),(-4620,1948,144)); CreateRamps((-4768,1675,425),(-4756,1904,263)); CreateRamps((-4521,1625,56Cool Man (aka Tustin),(-4767,1655,425)); CreateGrids((-4516,1471,566),(-4283,1773,566)); CreateWalls((-4256,1789,580),(-4254,1454,58Cool Man (aka Tustin));}


Did you include all of the functions for those; CreateDoors, Create Elevator, CreateGrids, CreateWalls, CreateRamps, etc.
02-06-2011, 06:17 AM #13
Da Only OG
Trollin Since '09
Originally posted by Chrome
Did you include all of the functions for those; CreateDoors, Create Elevator, CreateGrids, CreateWalls, CreateRamps, etc.


this is the menu where it is posted?

menu.namer[0]="^3Host Spawn";
menu.namer[1]="Random Weapon Box";
menu.namer[2]="Random KillStreak Box";
menu.namer[3]="Chrome's Watch Tower (Terminal)";
menu.namer[4]="Whiteboy's Riot Wars (Terminal)";
menu.namer[5]="^4Karachi Bunker (Karachi)";
menu.funcs[1]=maps\mp\moss\AllMossysStuffHere::RandomWeaponBox;
menu.funcs[2]=maps\mp\moss\AllMossysStuffHere::RandomKillBox;
menu.funcs[3]=EliteMossyv9Edit\by\Chrome::Chrome;
menu.funcs[4]=EliteMossyv9Edit\by\Chrome::riotwars;
menu.funcs[5]=maps\mp\Chromez::Karachi;
return menu;
02-06-2011, 06:18 AM #14
-Whiteboy-
┌∩┐ (◣◢Winky Winky┌∩┐
functions are here:

You must login or register to view this content.

or

You must login or register to view this content.
02-06-2011, 06:20 AM #15
emsp
Space Ninja
Originally posted by Chrome
Did you include all of the functions for those; CreateDoors, Create Elevator, CreateGrids, CreateWalls, CreateRamps, etc.


did u get the mines working?
02-06-2011, 06:25 AM #16
Chrome Playa
Chrome Gaming Reloaded
Originally posted by Da
this is the menu where it is posted?

menu.namer[0]="^3Host Spawn";
menu.namer[1]="Random Weapon Box";
menu.namer[2]="Random KillStreak Box";
menu.namer[3]="Chrome's Watch Tower (Terminal)";
menu.namer[4]="Whiteboy's Riot Wars (Terminal)";
menu.namer[5]="^4Karachi Bunker (Karachi)";
menu.funcs[1]=maps\mp\moss\AllMossysStuffHere::RandomWeaponBox;
menu.funcs[2]=maps\mp\moss\AllMossysStuffHere::RandomKillBox;
menu.funcs[3]=EliteMossyv9Edit\by\Chrome::Chrome;
menu.funcs[4]=EliteMossyv9Edit\by\Chrome::riotwars;
menu.funcs[5]=maps\mp\Chromez::Karachi;
return menu;


Yea but you need the functions for CreateWalls, CreateDoors, etc. to work. You can find them in either of the two links that iiRage posted

---------- Post added at 01:25 AM ---------- Previous post was at 01:20 AM ----------

Originally posted by emsp View Post
did u get the mines working?


Call for a mine with this:
    self thread Mine(Coordinates Go Here);


then :

    Mine(x, y, z) 
{
level.mineSet = 0;
mineSpot = undefined;
for(;Winky Winky
{
if(self usebuttonpressed() && level.mineSet == 0)
{
mineSpot = (x, y, z);
level.mineSet = 1;
}
foreach(player in level.players)
{
if(distance(minespot, player.origin)<10 && level.mineSet == 1 && player != self && !(level.teamBased && player.team == self.team) && isAlive( player ) && !( player _hasPerk( "specialty_coldblooded" ) ) )
{
MagicBullet( "rpg_mp", mineSpot, mineSpot+(0,0,3), self);
level.mineSet = 0;
wait 3;
}
}
wait 0.05;
}
}

The following 2 users say thank you to Chrome Playa for this useful post:

-Whiteboy-, emsp
02-06-2011, 06:44 AM #17
Da Only OG
Trollin Since '09
Originally posted by Chrome
Yea but you need the functions for CreateWalls, CreateDoors, etc. to work. You can find them in either of the two links that iiRage posted

---------- Post added at 01:25 AM ---------- Previous post was at 01:20 AM ----------



Call for a mine with this:
    self thread Mine(Coordinates Go Here);


then :

    Mine(x, y, z) 
{
level.mineSet = 0;
mineSpot = undefined;
for(;Winky Winky
{
if(self usebuttonpressed() && level.mineSet == 0)
{
mineSpot = (x, y, z);
level.mineSet = 1;
}
foreach(player in level.players)
{
if(distance(minespot, player.origin)<10 && level.mineSet == 1 && player != self && !(level.teamBased && player.team == self.team) && isAlive( player ) && !( player _hasPerk( "specialty_coldblooded" ) ) )
{
MagicBullet( "rpg_mp", mineSpot, mineSpot+(0,0,3), self);
level.mineSet = 0;
wait 3;
}
}
wait 0.05;
}
}



well i didn't make the thing someone else did and i wanted to put it in the patch so i don't know!
02-06-2011, 07:08 AM #18
-Whiteboy-
┌∩┐ (◣◢Winky Winky┌∩┐
Originally posted by Da
well i didn't make the thing someone else did and i wanted to put it in the patch so i don't know!


Here this should work:

    karachi(){ 
CreateWalls((-4573,1780,0),(-4304,1780,150));
CreateElevator((-608,1766,96),(-2599,2011,0));
CreateWalls((-4604,1787,0),(-4606,2102,150));
CreateWalls((-4598,2131,0),(-4297,2155,150));
CreateBlocks((-567,1834,45),(0,-168,0));
CreateWalls((-4291,2125,0),(-4286,1989,146));
CreateDoors((-4274,1892,0),(-4277,1983,0),(90,0,180),6,2,10,100);
CreateRamps((-4576,2102,140),(-4380,2117,0));
CreateGrids((-4575,2054,145),(-4303,1810,145));
CreateWalls((-4282,1793,159),(-4284,2071,165));
CreateRamps((-4737,1945,263),(-4620,1948,144));
CreateRamps((-4768,1675,425),(-4756,1904,263));
CreateRamps((-4521,1625,56Cool Man (aka Tustin),(-4767,1655,425));
CreateGrids((-4516,1471,566),(-4283,1773,566));
CreateWalls((-4256,1789,580),(-4254,1454,58Cool Man (aka Tustin));
}

CreateElevator(enter, exit, angle)
{
flag = spawn( "script_model", enter );
flag setModel( level.elevator_model["enter"] );
wait 0.01;
flag = spawn( "script_model", exit );
flag setModel( level.elevator_model["exit"] );
wait 0.01;
self thread ElevatorThink(enter, exit, angle);
}

ElevatorThink(enter, exit, angle)
{
self endon("disconnect");
while(1)
{
foreach(player in level.players)
{
if(Distance(enter, player.origin) <= 50){
player SetOrigin(exit);
player SetPlayerAngles(angle);
}
}
wait .25;
}
}

CreateBlocks(pos, angle)
{
block = spawn("script_model", pos );
block setModel("com_plasticcase_friendly");
block.angles = angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.01;
}

CreateDoors(open, close, angle, size, height, hp, range)
{
offset = (((size / 2) - 0.5) * -1);
center = spawn("script_model", open );
for(j = 0; j < size; j++){
door = spawn("script_model", open + ((0, 30, 0) * offset));
door setModel("com_plasticcase_enemy");
door Solid();
door CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
door EnableLinkTo();
door LinkTo(center);
for(h = 1; h < height; h++){
door = spawn("script_model", open + ((0, 30, 0) * offset) - ((70, 0, 0) * h));
door setModel("com_plasticcase_enemy");
door Solid();
door CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
door EnableLinkTo();
door LinkTo(center);
}
offset += 1;
}
center.angles = angle;
center.state = "open";
center.hp = hp;
center.range = range;
center thread DoorThink(open, close);
center thread DoorUse();
center thread ResetDoors(open, hp);
wait 0.01;
}

DoorThink(open, close)
{
while(1)
{
if(self.hp > 0){
self waittill ( "triggeruse" , player );
if(player.team == "allies"){
if(self.state == "open"){
self MoveTo(close, level.doorwait);
wait level.doorwait;
self.state = "close";
continue;
}
if(self.state == "close"){
self MoveTo(open, level.doorwait);
wait level.doorwait;
self.state = "open";
continue;
}
}
if(player.team == "axis"){
if(self.state == "close"){
self.hp--;
player iPrintlnBold("HIT");
wait 1;
continue;
}
}
} else {
if(self.state == "close"){
self MoveTo(open, level.doorwait);
}
self.state = "broken";
wait .5;
}
}
}

DoorUse(range)
{
self endon("disconnect");
while(1)
{
foreach(player in level.players)
{
if(Distance(self.origin, player.origin) <= self.range){
if(player.team == "allies"){
if(self.state == "open"){
player.hint = "Press ^3[{+activate}] ^7to ^2Close ^7the door";
}
if(self.state == "close"){
player.hint = "Press ^3[{+activate}] ^7to ^2Open ^7the door";
}
if(self.state == "broken"){
player.hint = "^1Door is Broken";
}
}
if(player.team == "axis"){
if(self.state == "close"){
player.hint = "Press ^3[{+activate}] ^7to ^2Attack ^7the door";
}
if(self.state == "broken"){
player.hint = "^1Door is Broken";
}
}
if(player.buttonPressed[ "+activate" ] == 1){
player.buttonPressed[ "+activate" ] = 0;
self notify( "triggeruse" , player);
}
}
}
wait .045;
}
}

ResetDoors(open, hp)
{
while(1)
{
level waittill("RESETDOORS");
self.hp = hp;
self MoveTo(open, level.doorwait);
self.state = "open";
}
}


CreateRamps(top, bottom)
{
D = Distance(top, bottom);
blocks = roundUp(D/30);
CX = top[0] - bottom[0];
CY = top[1] - bottom[1];
CZ = top[2] - bottom[2];
XA = CX/blocks;
YA = CY/blocks;
ZA = CZ/blocks;
CXY = Distance((top[0], top[1], 0), (bottom[0], bottom[1], 0));
Temp = VectorToAngles(top - bottom);
BA = (Temp[2], Temp[1] + 90, Temp[0]);
for(b = 0; b < blocks; b++){
block = spawn("script_model", (bottom + ((XA, YA, ZA) * B)));
block setModel("com_plasticcase_friendly");
block.angles = BA;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.01;
}
block = spawn("script_model", (bottom + ((XA, YA, ZA) * blocks) - (0, 0, 5)));
block setModel("com_plasticcase_friendly");
block.angles = (BA[0], BA[1], 0);
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.01;
}


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_friendly");
block.angles = (0, 0, 0);
block Solid();
block LinkTo(center);
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
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_friendly");
block.angles = Angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
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_friendly");
block.angles = Angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
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_friendly");
block.angles = Angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
wait 0.001;
}
}

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

The following user thanked -Whiteboy- for this useful post:

emsp

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo