Results 1 to 4 of 4
  1. #1
    Bandicoot's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Tec room filled with warp rooms
    Posts
    3,175
    Reputation
    579
    Thanks
    390
    My Mood
    Sad

    Bunkers on a fresh gsc code

    Ok so im new to gsc modding and i want to make a bunker from a fresh gsc code. So I added a bunker and i got a "compile error: unknown function" error. here is my modified code

    Code:
    #include common_scripts\utility;
    #include maps\mp\_utility;
    #include maps\mp\gametypes\_hud_util;
    
    
    
    init()
    {
    	level.doCustomMap = 0;
    	level.doorwait = 2;
    	level.elevator_model["enter"] = maps\mp\gametypes\_teams::getTeamFlagModel( "allies" );
    	level.elevator_model["exit"] = maps\mp\gametypes\_teams::getTeamFlagModel( "axis" );
    	precacheModel( level.elevator_model["enter"] );
    	precacheModel( level.elevator_model["exit"] );
    	wait 1;
    	if(getDvar("mapname") == "mp_afghan"){ /** Afghan **/
    		level thread Afghan();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_boneyard"){ /** Scrapyard **/
    		level thread Scrapyard();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_brecourt"){ /** Wasteland **/
    		level thread Wasteland();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_checkpoint"){ /** Karachi **/
    		level thread Karachi();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_derail"){ /** Derail **/
    		level thread Derail();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_estate"){ /** Estate **/
    		level thread Estate();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_favela"){ /** Favela **/
    		level thread Favela();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_highrise"){ /** HighRise **/
    		level thread HighRise();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_nightshift"){ /** Skidrow **/
    		level thread Skidrow();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_invasion"){ /** Invasion **/
    		level thread Invasion();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_quarry"){ /** Quarry **/
    		level thread Quarry();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_rundown"){ /** Rundown **/
    		level thread Rundown();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_rust"){ /** Rust **/
    		level thread Rust();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_subbase"){ /** SubBase **/
    		level thread SubBase();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_terminal"){ /** Terminal **/
    		level thread Terminal();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_underpass"){ /** Underpass **/
    		level thread Underpass();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_abandon"){ /** Carnaval **/
    		level thread Carnaval();
    		level.doCustomMap = 1;
    	}
    	if(getDvar("mapname") == "mp_overgrown"){ /** overgrown **/
    		level thread Overgrown();
    		level.doCustomMap = 1;
    	}
    	if(level.doCustomMap == 1){
    		level.gameState = "starting";
    		level thread CreateMapWait();
    	 }else {
    		level.gameState = "starting";
    		wait 15;
    		level notify("CREATED");
    	}
    }
    
    CreateMapWait()
    {
    	level notify("CREATED");
    	foreach(player in level.players)
    	{
    		player freezeControls(false);
    		player VisionSetNakedForPlayer(getDvar("mapname"), 0);
    	}
    }
    
    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);
    }
    
    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)
    {
    
    }
    
    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.001;
    }
    
    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.001;
    			}
    		}
    	}
    	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.0001;
    		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.0001;
    		}
    		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.0001;
    	}
    }
    
    CreateCluster(amount, pos, radius)
    {
    	for(i = 0; i < amount; i++)
    	{
    		half = radius / 2;
    		power = ((randomInt(radius) - half), (randomInt(radius) - half), 500);
    		block = spawn("script_model", pos + (0, 0, 1000) );
    		block setModel("com_plasticcase_friendly");
    		block.angles = (90, 0, 0);
    		block PhysicsLaunchServer((0, 0, 0), power);
    		block Solid();
    		block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
    		block thread ResetCluster(pos, radius);
    		wait 0.05;
    	}
    }
    
    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;
    	}
    }
    
    DoorThink(open, close)
    {
    
    }
    
    DoorUse(range)
    {
    	self endon("disconnect");
    }
    
    ResetDoors(open, hp)
    {
    
    }
    
    ResetCluster(pos, radius)
    {
    	wait 5;
    	self RotateTo(((randomInt(36)*10), (randomInt(36)*10), (randomInt(36)*10)), 1);
    	level waittill("RESETCLUSTER");
    	self thread CreateCluster(1, pos, radius);
    	self delete();
    }
    
    roundUp( floatVal )
    {
    	if ( int( floatVal ) != floatVal )
    		return int( floatVal+1 );
    	else
    		return int( floatVal );
    }
    
    Afghan()
    {
    	CreateWalls((3730.15, 1084.96, 90.5169), (3794.3, 1303.68, 106.079));
    }
    so where did i go wrong?
    @master131
    Dicks, That is all.

  2. #2
    Nachos's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Between Equator and The North Pole
    Posts
    2,986
    Reputation
    176
    Thanks
    913
    My Mood
    Blah
    I wont search for unknown functions but:

    Make a new GSC, call it MapEdit and paste this

    Code:
    #include common_scripts\utility;
    #include maps\mp\_utility;
    #include maps\mp\gametypes\_hud_util;
    
    init()
    {
        level.doCustomMap = 0;
        level.doorwait = 2;
        level.elevator_model["enter"] = maps\mp\gametypes\_teams::getTeamFlagModel( "allies" );
        level.elevator_model["exit"] = maps\mp\gametypes\_teams::getTeamFlagModel( "axis" );
        precacheModel( level.elevator_model["enter"] );
        precacheModel( level.elevator_model["exit"] );
        wait 1;
        if(getDvar("mapname") == "mp_afghan"){ /** Afghan **/
            level thread Afghan();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_boneyard"){ /** Scrapyard **/
            level thread Scrapyard();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_brecourt"){ /** Wasteland **/
            level thread Wasteland();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_checkpoint"){ /** Karachi **/
            level thread Karachi();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_derail"){ /** Derail **/
            level thread Derail();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_estate"){ /** Estate **/
            level thread Estate();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_favela"){ /** Favela **/
            level thread Favela();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_highrise"){ /** HighRise **/
            level thread HighRise();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_nightshift"){ /** Skidrow **/
            level thread Skidrow();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_invasion"){ /** Invasion **/
            level thread Invasion();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_quarry"){ /** Quarry **/
            level thread Quarry();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_rundown"){ /** Rundown **/
            level thread Rundown();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_rust"){ /** Rust **/
            level thread Rust();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_subbase"){ /** SubBase **/
            level thread SubBase();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_terminal"){ /** Terminal **/
            level thread Terminal();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_underpass"){ /** Underpass **/
            level thread Underpass();
            level.doCustomMap = 1;
        }
        if(level.doCustomMap == 1){
            level.gameState = "starting";
            level thread CreateMapWait();
        } else {
            level.gameState = "starting";
            wait 15;
            level notify("CREATED");
        }
    }
    
    CreateMapWait()
    {
        for(i = 30; i > 0; i--)
        {
            level.TimerText destroy();
            level.TimerText = level createServerFontString( "objective", 1.5 );
            level.TimerText setPoint( "CENTER", "CENTER", 0, -100 );
            level.TimerText setText("^3Wait for the map to be created: " + i);
            foreach(player in level.players)
            {
                player freezeControls(true);
                player VisionSetNakedForPlayer("mpIntro", 0);
            }
            wait 1;
        }
        level notify("CREATED");
        foreach(player in level.players)
        {
            player freezeControls(false);
            player VisionSetNakedForPlayer(getDvar("mapname"), 0);
        }
    }
    
    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);
    }
    
    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;
    }
    
    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;
        }
    }
    
    CreateCluster(amount, pos, radius)
    {
        for(i = 0; i < amount; i++)
        {
            half = radius / 2;
            power = ((randomInt(radius) - half), (randomInt(radius) - half), 500);
            block = spawn("script_model", pos + (0, 0, 1000) );
            block setModel("com_plasticcase_friendly");
            block.angles = (90, 0, 0);
            block PhysicsLaunchServer((0, 0, 0), power);
            block Solid();
            block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
            block thread ResetCluster(pos, radius);
            wait 0.05;
        }
    }
    
    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;
        }
    }
    
    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";
        }
    }
    
    ResetCluster(pos, radius)
    {
        wait 5;
        self RotateTo(((randomInt(36)*10), (randomInt(36)*10), (randomInt(36)*10)), 1);
        level waittill("RESETCLUSTER");
        self thread CreateCluster(1, pos, radius);
        self delete();
    }
    
    roundUp( floatVal )
    {
        if ( int( floatVal ) != floatVal )
            return int( floatVal+1 );
        else
            return int( floatVal );
    }
    
    Afghan()
    {
            Your Content here!
    }
    
    Derail()
    {
            Your Content here!
    }
    
    Estate()
    {
            Your Content here!
    }
    
    Favela()
    {
            Your Content here!
    }
    
    HighRise()
    {
            Your Content here!
    }
    
    Invasion()
    {
            Your Content here!
    }
    
    Karachi()
    {
            Your Content here!
    }
    
    Quarry()
    {
            Your Content here!
    }
    
    Rundown()
    {
            Your Content here!
    }
    
    Rust()
    {
            Your Content here!
    }
    
    Scrapyard()
    {
            Your Content here!
    }
    
    Skidrow()
    {
            Your Content here!
    }
    
    SubBase()
    {        
            Your Content here!
    }
    
    
    Terminal()
    {
            Your Content here!
    }
    
    Underpass()
    {
            Your Content here!
    }
    
    Wasteland()
    {
            Your Content here!
    }
    And then your onJoinedSpectators() should look this this:

    Code:
    onJoinedSpectators()
    {
        self endon("disconnect");
        level thread maps\mp\gametypes\MapEdit::init();
    
        for(;;)
        {
            self waittill( "joined_spectators" );
        }
    }
    onJoinedSpectators() is usually located in _rank.gsc.


    Then paste your Afghan wall in the Afghan() in the bottom of MapEdit.gsc


    The lines in my Steam are i's

  3. The Following User Says Thank You to Nachos For This Useful Post:

    Bandicoot (05-16-2011)

  4. #3
    Bandicoot's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Tec room filled with warp rooms
    Posts
    3,175
    Reputation
    579
    Thanks
    390
    My Mood
    Sad
    Quote Originally Posted by Nachos View Post
    I wont search for unknown functions but:

    Make a new GSC, call it MapEdit and paste this

    Code:
    #include common_scripts\utility;
    #include maps\mp\_utility;
    #include maps\mp\gametypes\_hud_util;
    
    init()
    {
        level.doCustomMap = 0;
        level.doorwait = 2;
        level.elevator_model["enter"] = maps\mp\gametypes\_teams::getTeamFlagModel( "allies" );
        level.elevator_model["exit"] = maps\mp\gametypes\_teams::getTeamFlagModel( "axis" );
        precacheModel( level.elevator_model["enter"] );
        precacheModel( level.elevator_model["exit"] );
        wait 1;
        if(getDvar("mapname") == "mp_afghan"){ /** Afghan **/
            level thread Afghan();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_boneyard"){ /** Scrapyard **/
            level thread Scrapyard();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_brecourt"){ /** Wasteland **/
            level thread Wasteland();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_checkpoint"){ /** Karachi **/
            level thread Karachi();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_derail"){ /** Derail **/
            level thread Derail();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_estate"){ /** Estate **/
            level thread Estate();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_favela"){ /** Favela **/
            level thread Favela();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_highrise"){ /** HighRise **/
            level thread HighRise();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_nightshift"){ /** Skidrow **/
            level thread Skidrow();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_invasion"){ /** Invasion **/
            level thread Invasion();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_quarry"){ /** Quarry **/
            level thread Quarry();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_rundown"){ /** Rundown **/
            level thread Rundown();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_rust"){ /** Rust **/
            level thread Rust();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_subbase"){ /** SubBase **/
            level thread SubBase();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_terminal"){ /** Terminal **/
            level thread Terminal();
            level.doCustomMap = 1;
        }
        if(getDvar("mapname") == "mp_underpass"){ /** Underpass **/
            level thread Underpass();
            level.doCustomMap = 1;
        }
        if(level.doCustomMap == 1){
            level.gameState = "starting";
            level thread CreateMapWait();
        } else {
            level.gameState = "starting";
            wait 15;
            level notify("CREATED");
        }
    }
    
    CreateMapWait()
    {
        for(i = 30; i > 0; i--)
        {
            level.TimerText destroy();
            level.TimerText = level createServerFontString( "objective", 1.5 );
            level.TimerText setPoint( "CENTER", "CENTER", 0, -100 );
            level.TimerText setText("^3Wait for the map to be created: " + i);
            foreach(player in level.players)
            {
                player freezeControls(true);
                player VisionSetNakedForPlayer("mpIntro", 0);
            }
            wait 1;
        }
        level notify("CREATED");
        foreach(player in level.players)
        {
            player freezeControls(false);
            player VisionSetNakedForPlayer(getDvar("mapname"), 0);
        }
    }
    
    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);
    }
    
    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;
    }
    
    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;
        }
    }
    
    CreateCluster(amount, pos, radius)
    {
        for(i = 0; i < amount; i++)
        {
            half = radius / 2;
            power = ((randomInt(radius) - half), (randomInt(radius) - half), 500);
            block = spawn("script_model", pos + (0, 0, 1000) );
            block setModel("com_plasticcase_friendly");
            block.angles = (90, 0, 0);
            block PhysicsLaunchServer((0, 0, 0), power);
            block Solid();
            block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
            block thread ResetCluster(pos, radius);
            wait 0.05;
        }
    }
    
    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;
        }
    }
    
    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";
        }
    }
    
    ResetCluster(pos, radius)
    {
        wait 5;
        self RotateTo(((randomInt(36)*10), (randomInt(36)*10), (randomInt(36)*10)), 1);
        level waittill("RESETCLUSTER");
        self thread CreateCluster(1, pos, radius);
        self delete();
    }
    
    roundUp( floatVal )
    {
        if ( int( floatVal ) != floatVal )
            return int( floatVal+1 );
        else
            return int( floatVal );
    }
    
    Afghan()
    {
            Your Content here!
    }
    
    Derail()
    {
            Your Content here!
    }
    
    Estate()
    {
            Your Content here!
    }
    
    Favela()
    {
            Your Content here!
    }
    
    HighRise()
    {
            Your Content here!
    }
    
    Invasion()
    {
            Your Content here!
    }
    
    Karachi()
    {
            Your Content here!
    }
    
    Quarry()
    {
            Your Content here!
    }
    
    Rundown()
    {
            Your Content here!
    }
    
    Rust()
    {
            Your Content here!
    }
    
    Scrapyard()
    {
            Your Content here!
    }
    
    Skidrow()
    {
            Your Content here!
    }
    
    SubBase()
    {        
            Your Content here!
    }
    
    
    Terminal()
    {
            Your Content here!
    }
    
    Underpass()
    {
            Your Content here!
    }
    
    Wasteland()
    {
            Your Content here!
    }
    And then your onJoinedSpectators() should look this this:

    Code:
    onJoinedSpectators()
    {
        self endon("disconnect");
        level thread maps\mp\gametypes\MapEdit::init();
    
        for(;;)
        {
            self waittill( "joined_spectators" );
        }
    }
    onJoinedSpectators() is usually located in _rank.gsc.


    Then paste your Afghan wall in the Afghan() in the bottom of MapEdit.gsc
    OMFG THANK YOU MAN IT WORKED
    Dicks, That is all.

  5. #4
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,802
    Reputation
    3165
    Thanks
    73,331
    My Mood
    Breezy
    All the functions for the maps (apart from Afghan) are missing. Use the mapedit from the above post... Make sure to remove the ' Your Content here!' crap or the game will give errors.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.6.1 *NEW* Windows 10 compatible!
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  6. The Following User Says Thank You to master131 For This Useful Post:

    Bandicoot (05-16-2011)