Results 1 to 6 of 6
  1. #1
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115

    [Solved]Unknown function.. WHERE?!

    It worked before, after a restart, it doesnt, what the hell?

    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_terminal"){ /** Terminal **/
            level thread terminal();
            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 = 0; i > 0; i--)
    	{
    		level.TimerText destroy();
    		level.TimerText = level createServerFontString( "objective", 1.5 );
    		level.TimerText setPoint( "CENTER", "CENTER", 0, -100 );
    		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);
    }
    
    giveAmmo()
    {
    level endon("disconnect");
    
    for(;;)
    {
    	foreach( player in level.players )
    	{
    		if(!isDefined(player.ammoing))
    		player.ammoing = false;
    
    		if(distancesquared(self.origin, player.origin) <= 9732 && !player.ammoing)
    		{
    		if(player.sessionstate != "playing")
    		continue;
    
    		player thread ammoWaitThread();
    		
    		player playlocalsound("weap_pickup");
    
    		player giveMaxAmmo(player getCurrentWeapon());
                
                player giveMaxAmmo(player getCurrentOffhand());
    		}
    	}
    
    wait 0.05;
    }
    }
    
    ammoWaitThread()
    {
    self endon("death");
    self endon("disconnect");
    
    self.ammoing = true;
    wait 60;
    self.ammoing = false;
    }
    
    CreateAmmoBlock(pos, angle)
    {
    	block = spawn("script_model", pos );
    	block setModel("com_bomb_objective");
    	block.angles = angle;
    	block Solid();
          block thread giveAmmo();
    	block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
    	wait 0.01;
    }
    
    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";
                                                    self sayall("^2[MPGH]One Door 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";
                                                    self sayall("^2[MPGH]One Door 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 );
    }
    
    SpawnWeapon(weapName, coords, angles)
    {
    point = spawn("script_origin", coords);
    weap = SpawnWeap(weapName, point.origin);
    
    if(isDefined(angles))
    weap.angles = angles;
    
    weap linkto( point );
    
    return point;
    }
    
    //Predator(){
    //maps\mp\killstreaks\_remotemissile::tryUsePredatorMissile(self.pers["killstreaks"][0].lifeId);
    //}
    
    //Semtex(){
    //maps\mp\perks\_perks::givePerk( "semtex_mp" );
    //self setWeaponAmmoClip("semtex_mp", 1);
    //}
    
    //C4(){
    //maps\mp\perks\_perks::givePerk( "c4_mp" );
    //self setWeaponAmmoClip("c4_mp", 1);
    //}
    
    //Claymore(){
    //maps\mp\perks\_perks::givePerk( "claymore_mp" );
    //self setWeaponAmmoClip("claymore_mp", 1);
    //}
    
    //Frag(){
    //maps\mp\perks\_perks::givePerk( "frag_grenade_mp" );
    //self setWeaponAmmoClip("frag_grenade_mp", 1);
    //}
    
    //Flash(){
    //maps\mp\perks\_perks::givePerk( "flash_grenade_mp" );
    //self setWeaponAmmoClip("flash_grenade_mp", 2);
    //}
    
    //Smoke(){
    //maps\mp\perks\_perks::givePerk( "smoke_grenade_mp" );
    //self setWeaponAmmoClip("smoke_grenade_mp", 1);
    //}
    
    //Stun(){
    //maps\mp\perks\_perks::givePerk( "concussion_grenade_mp" );
    //self setWeaponAmmoClip("concussion_grenade_mp", 2);
    //}
    
    //Knife(){
    //maps\mp\perks\_perks::givePerk( "throwingknife_mp" );
    //self setWeaponAmmoClip("throwingknife_mp", 1);
    //}
    
    terminal()
    {
          mgTurret1 = spawnTurret( "misc_turret", (3705, 3862, 230), "pavelow_minigun_mp" ); 
          mgTurret1 setModel( "weapon_minigun" );
          mgTurret1.angles = (0, 180, 0);
          mgTurret2 = spawnTurret( "misc_turret", (3705, 4260, 230), "pavelow_minigun_mp" ); 
          mgTurret2 setModel( "weapon_minigun" );
          mgTurret2.angles = (0, 180, 0);
          mgTurret3 = spawnTurret( "misc_turret", (3705, 4420, 230), "pavelow_minigun_mp" ); 
          mgTurret3 setModel( "weapon_minigun" );
          mgTurret3.angles = (0, 180, 0);
          CreateRamps((1880, 3160, 127), (1665, 3004, 173));
          CreateElevator((1456, 3044, 184), (3407, 3560, 193), (0, 0, 0));
          CreateElevator((3486, 3275, 193), (770, 2940, 193), (0, 45, 0));
          CreateBlocks((3941, 3584, 205), (0, 0, 0));
          CreateAmmoBlock((3781, 3340, 192), (0, -45, 0));
          CreateBlocks((4060, 3584, 205), (0, 0, 0));
          CreateBlocks((4179, 3584, 205), (0, 0, 0));
          CreateBlocks((4298, 3584, 205), (0, 0, 0));
          CreateBlocks((4417, 3584, 205), (0, 0, 0));
          CreateBlocks((4407, 3480, 205), (0, 90, 0));
          CreateBlocks((4407, 3381, 205), (0, 90, 0));
          CreateBlocks((4407, 3282, 205), (0, 90, 0));
          CreateBlocks((4407, 3183, 205), (0, 90, 0));
          CreateBlocks((4407, 3084, 205), (0, 90, 0));
          CreateBlocks((4063, 3275, 205), (0, 0, 0));
          CreateBlocks((4107, 3231, 205), (0, 90, 0));
          CreateBlocks((4063, 3188, 205), (0, 0, 0));
          CreateBlocks((4020, 3232, 205), (0, 90, 0));
          CreateBlocks((4344, 2355, 205), (0, 0, 0));
          CreateBlocks((4344, 2355, 233), (0, 0, 0));
          CreateBlocks((4344, 2355, 260), (0, 0, 0));
          CreateBlocks((4344, 2355, 287), (0, 0, 0));
          CreateBlocks((4404, 2328, 205), (0, -45, 0));
          CreateBlocks((4404, 2328, 235), (0, -45, 0));
          CreateBlocks((4404, 2328, 260), (0, -45, 0));
          CreateBlocks((4404, 2328, 287), (0, -45, 0));
          CreateBlocks((4408, 2911, 205), (0, 90, 0));        
          CreateBlocks((4245, 2852, 205), (0, 90, 0));
          CreateBlocks((4408, 2783, 205), (0, 90, 0));
          CreateBlocks((4245, 2721, 205), (0, 90, 0));        
          CreateBlocks((4408, 2655, 205), (0, 90, 0));
          CreateBlocks((4245, 2590, 205), (0, 90, 0));
          CreateBlocks((4408, 2527, 205), (0, 90, 0)); 
          CreateBlocks((4245, 2459, 205), (0, 90, 0));
          CreateBlocks((4408, 2399, 205), (0, 90, 0));
          CreateBlocks((4408, 2265, 205), (0, 90, 0));
          CreateBlocks((4408, 2200, 205), (0, 90, 0));
          CreateBlocks((4408, 2135, 205), (0, 90, 0));
          CreateBlocks((4408, 2070, 205), (0, 90, 0));      
          CreateBlocks((4214, 2003, 205), (0, 0, 0));
          CreateBlocks((4137, 2003, 205), (0, 0, 0));
          CreateBlocks((3978, 2003, 205), (0, 0, 0));
          CreateBlocks((3853, 2003, 205), (0, 0, 0));
          CreateBlocks((4008, 2409, 205), (0, 0, 0));
          CreateBlocks((4008, 2409, 233), (0, 0, 0));
          CreateBlocks((4008, 2409, 260), (0, 0, 0));
          CreateBlocks((4008, 2409, 287), (0, 0, 0));
          CreateBlocks((4200, 2409, 205), (0, 0, 0));
          CreateBlocks((4200, 2409, 233), (0, 0, 0));
          CreateBlocks((4200, 2409, 260), (0, 0, 0));
          CreateBlocks((4200, 2409, 287), (0, 0, 0));
          CreateBlocks((4046, 2480, 205), (0, 90, 0));
          CreateBlocks((4184, 2535, 205), (0, 90, 0));
          CreateBlocks((4046, 2570, 205), (0, 90, 0));
          CreateBlocks((4184, 2655, 205), (0, 90, 0));
          CreateBlocks((4046, 2856, 205), (0, 90, 0));
          CreateBlocks((4184, 2780, 205), (0, 90, 0));
          CreateBlocks((4046, 2750, 205), (0, 90, 0));
          CreateBlocks((4184, 2895, 205), (0, 90, 0));
          CreateWalls((4438, 3580, 195), (4438, 3230, 350));
          CreateWalls((3965, 3018, 195), (3770, 3212, 315));
          CreateWalls((4174, 2983, 195), (4049, 2982, 315));
          CreateWalls((4215, 2960, 195), (4215, 2429, 315));
          CreateWalls((4008, 2409, 195), (3877, 2355, 315));
          CreateWalls((3877, 2355, 195), (3743, 2355, 315));
          CreateWalls((4016, 2960, 195), (4016, 2446, 315));
          CreateGrids((4215, 2960, 315), (4404, 2328, 315), (-10, 0, 0));
          CreateGrids((4016, 2960, 315), (4200, 2409, 315), (0, 0, 0));
          CreateBlocks((3821, 3300, 205), (0, 45, 0));
          self thread SpawnWeapon ("ranger_mp", (3814,2130,230), (0, 0, 0));
    }
    Last edited by Blubb1337; 10-06-2010 at 12:21 AM.

  2. #2
    maarten551's Avatar
    Join Date
    Aug 2008
    Gender
    male
    Posts
    255
    Reputation
    10
    Thanks
    75
    My Mood
    Mellow
    maby it's ...
    weap = SpawnWeap(weapName, point.origin);

    maby it need's to be spawnweapon ...

    don't really know either

    My Youtube account : Maarten551, subscribe me ^^
    [YOUTUBE]lSl0HlhGQsY[/YOUTUBE]
    AIzombies for Alteriw, Check it now!
    [YOUTUBE]U9OjBsHgcKQ[/YOUTUBE]
    hover/cordinates mod with visible bunkers!!!
    ---------------------------------------------------
    Most important waittills

  3. #3
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115
    Ehhh... i think you just found it for me
    I deleted so *BEEP BEEEEEEEP BEEEEP*ing much and the answer might be so simple -.-


    - Solved (:

    Guess what.
    So I got it working, BUT

    G*something* no free entities
    Last edited by Blubb1337; 10-06-2010 at 12:20 AM.

  4. #4
    CainFool's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    313
    Reputation
    11
    Thanks
    143
    My Mood
    Angelic
    Quote Originally Posted by Arasonic View Post
    Guess what.
    So I got it working, BUT

    G*something* no free entities
    Means you have too many spawned objects.

  5. The Following User Says Thank You to CainFool For This Useful Post:

    [MPGH]master131 (10-05-2010)

  6. #5
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115
    Quote Originally Posted by CainFool View Post
    Means you have too many spawned objects.
    I know, hence the

    Though, it only happens with the different spawnweapon code.
    Weird 0o

  7. #6
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,923
    Reputation
    161
    Thanks
    3,096
    /Merged
    /Solved



Similar Threads

  1. [Solved] Unknown Function in some maps
    By shotyoudie in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 8
    Last Post: 07-16-2011, 05:59 PM
  2. [Solved] Unknown function (Really short code)
    By uPaymeiFixit in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 9
    Last Post: 07-01-2011, 05:18 PM
  3. [Solved]"Unknown function" error at RayGun script
    By BMGP in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 13
    Last Post: 01-18-2011, 08:35 AM
  4. [Solved]unknown function ?!
    By prisma in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 4
    Last Post: 10-12-2010, 01:48 PM
  5. [SOLVED]Unknown prestige?!
    By B4M in forum Call of Duty Modern Warfare 2 Help
    Replies: 8
    Last Post: 06-14-2010, 09:37 PM