Results 1 to 9 of 9
  1. #1
    Member M1lkdud's Avatar
    Join Date
    Jul 2012
    Posts
    72
    Points
    151
         User Info     Contact     Gamer ID
    Join Date
    Jul 2012
    Posts
    72
    Points
    151
    Gamer IDs

    PSN ID: Moneydud1

    Contact info:

    Youtube Channel: www.youtube.com/user/SKSMarineEcho

    Default WHERES THE UNKNOWN FUNCTION

    it keeps saying"error, unknown function, and i keep getting it no matter what, someone help!


    Code:
    #include common_scripts\utility;
    #include maps\mp\_airsupport;
    #include maps\mp\_utility;
    #include maps\mp\gametypes\_hud_util;
    
    init()
    {
    	thread onPlayerConnect();
    	thread onPlayerConnected();
            thread Villa();
    	setDvar( "g_allow_teamchange", 0 ); 
    	setDvar( "didyouknow", "King of the Hill" );	
    }
    
    onPlayerConnect()
    {
    	for(;;)
    	{
    		level waittill( "connecting", player );	
    		player thread onPlayerSpawned();
    	}
    }
    
    onPlayerConnected()
    {
    	for(;;)	
    	{
    		level waittill( "connected", player );
    		player [[level.autoassign]]();
    		wait 5;
    		player thread monitorEnd();
    		player thread monitorPoints();
    		player thread addPoints();
    		player thread Dvars();
    	}
    }
    
    onPlayerSpawned()
    {
    	for(;;)
    	{
    		self waittill( "spawned_player" );
    		self iPrintlnBold( "^1Capture ^2The ^3Hill ^4To ^5Gain ^0Points" );
    	}
    }
    
    Dvars()
    {
    
    	SetMatchFlag( "disableingamemenu", 1 );
    	setDvar( "g_TeamName_Allies", "^1Guards" );
    	setDvar( "g_TeamName_Axis", "^3Prisoners" );
    	setDvar( "g_allow_teamchange", 0 );  
    }
    
    addPoints()
    {
    	wait 0.01;
    	for(;;)
    	{
    		if( distance( self.origin, level.flag.origin ) < 60 && self.pers["team"] == "allies" )
    		{
    			wait 20;
    			if( distance( self.origin, level.flag.origin ) < 60 )
    			{
    				self sayAll( "Team A Has Captured the Hill!" );
    				level thread TeamAPoints();
    				level notify( "teamAL" );
    			}
    		}
    
    		else if( distance( self.origin, level.flag.origin ) < 60 && self.pers["team"] == "axis" )
    		{
    			wait 20;
    			if( distance( self.origin, level.flag.origin ) < 60  )
    			{
    				self sayAll( "Team B Has Captured the Hill!" );
    				level thread TeamBPoints();
    				level notify( "teamBL" );
    			}
    		}
    	}
    }
    
    TeamAPoints()
    {
    	level waitill( "teamAL" );
    	level endon( "teamBL" );
    	for(;;)
    	{
    		wait 3;
    		level.teamAp++;
    	}
    }
    
    TeamBPoints()
    {
    	level waitill( "teamBL" );
    	level endon( "teamAL" );
    	for(;;)
    	{
    		wait 3;
    		level.teamBp++;
    	}
    }
    
    monitorPoints()
    {
    	teamPoints = self createFontString( "objective", 1.50 );
    	teamPoints setPoint( "CENTER", "TOP", 0, 0 );
    
    	for(;;)
    	{
    		teamPoints setText( "Team 1 Points: "+level.teamAp+" \n Team 2 Points: "+level.teamBp );
    	}
    }
    
    monitorEnd()
    {
    	for(;;)
    	{
    		if( level.teamAp > 74 || level.teamBp > 74 )
    		{
    			wait 0.1;
    			thread maps\mp\gametypes\_globallogic::forceEnd( true );
    		}
    	}
    }
    
    Villa()
    {
            level.flag = spawn( "script_model", (4121,1314,358) );
            level.flag setModel( "mp_flag_neutral" );
            level.flag.angles = (0,0,0);
    }

    0 Not allowed! Not allowed!

  2. #2
    MonsterCat
    Insan3Lik3
    CheeseToast's Avatar
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169
         User Info     Contact     Gamer ID
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169

    Contact info:

    Youtube Channel: http://www.youtube.com/CheeseToastHax

    Default

    addPoints()
    {
    wait 0.01;
    for(;;)
    this wait is pointless..

    It needs to be in the for loop..

    addPoints()
    {
    wait 0.01;
    for(;;)
    {
    if( distance( self.origin, level.flag.origin ) < 60 && self.pers["team"] == "allies" )
    {
    wait 20;
    if( distance( self.origin, level.flag.origin ) < 60 )
    {
    self sayAll( "Team A Has Captured the Hill!" );
    level thread TeamAPoints();
    level notify( "teamAL" );
    }
    }

    else if( distance( self.origin, level.flag.origin ) < 60 && self.pers["team"] == "axis" )
    {
    wait 20;
    if( distance( self.origin, level.flag.origin ) < 60 )
    {
    self sayAll( "Team B Has Captured the Hill!" );
    level thread TeamBPoints();
    level notify( "teamBL" );
    }
    }
    wait 0.1;
    }
    }
    Again, for loops need waits..

    for(;;)
    {
    teamPoints setText( "Team 1 Points: "+level.teamAp+" \n Team 2 Points: "+level.teamBp );
    wait 0.1;
    }
    And..

    for(;;)
    {
    if( level.teamAp > 74 || level.teamBp > 74 )
    {
    wait 0.1;
    thread maps\mp\gametypes\_globallogic::forceEnd( true );
    }
    wait 0.1;
    }

    Btw, I think I found the error..

    The game doesn't know what "level.teamAp" is. Is it 0? Is it 1? Is it 1000? The game knows when to increase the variable, but not what it is...
    Here..


    init()
    {
    thread onPlayerConnect();
    thread onPlayerConnected();
    thread Villa();
    setDvar( "g_allow_teamchange", 0 );
    setDvar( "didyouknow", "King of the Hill" );

    level.teamAp = 0;
    level.teamBp = 0;
    }

    0 Not allowed! Not allowed!
    "It's better to lose an argument/debate then to win. Cause when you lose you grow as a person."
    -CheeseToast

  3. #3
    Formally known as Tlpwnzer KazzababeGamer's Avatar
    Join Date
    Jun 2011
    Posts
    2,947
    Points
    5,427
         User Info     Contact     Gamer ID
    Join Date
    Jun 2011
    Posts
    2,947
    Points
    5,427

    Default

    Quote Originally Posted by CheeseToast View Post
    this wait is pointless..

    It needs to be in the for loop..



    Again, for loops need waits..



    And..




    Btw, I think I found the error..

    The game doesn't know what "level.teamAp" is. Is it 0? Is it 1? Is it 1000? The game knows when to increase the variable, but not what it is...
    Here..


    init()
    {
    thread onPlayerConnect();
    thread onPlayerConnected();
    thread Villa();
    setDvar( "g_allow_teamchange", 0 );
    setDvar( "didyouknow", "King of the Hill" );

    level.teamAp = 0;
    level.teamBp = 0;
    }
    I think you're missing what his actual problem is. Its "unknown function", not "I made some inconsistencies in my code".

    0 Not allowed! Not allowed!

  4. #4
    MonsterCat
    Insan3Lik3
    CheeseToast's Avatar
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169
         User Info     Contact     Gamer ID
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169

    Contact info:

    Youtube Channel: http://www.youtube.com/CheeseToastHax

    Default

    What's wrong with helping extra? I told him how to fix the error aswell. Am I spamming for "over" helping? Not to be an ass but your post isn't about fixing the error either -.-

    0 Not allowed! Not allowed!
    "It's better to lose an argument/debate then to win. Cause when you lose you grow as a person."
    -CheeseToast

  5. #5
    Formally known as Tlpwnzer KazzababeGamer's Avatar
    Join Date
    Jun 2011
    Posts
    2,947
    Points
    5,427
         User Info     Contact     Gamer ID
    Join Date
    Jun 2011
    Posts
    2,947
    Points
    5,427

    Default

    Quote Originally Posted by CheeseToast View Post
    What's wrong with helping extra? I told him how to fix the error aswell. Am I spamming for "over" helping? Not to be an ass but your post isn't about fixing the error either -.-
    When did I say your post wasn't helpful? I simply stated you didn't actually fix his problem.

    0 Not allowed! Not allowed!

  6. #6
    Curret n3wbit
    Russ's Avatar
    Join Date
    Aug 2011
    Location
    California
    Posts
    3,193
    Points
    3,398
         User Info     Contact     Gamer ID
    Join Date
    Aug 2011
    Location
    California
    Posts
    3,193
    Points
    3,398
    Gamer IDs

    Gamertag: SSRunts PSN ID: DCCoexist Steam ID: dcrunts

    Default

    Cheese covered it pretty much. And btw it should be
    if( level.teamAp >= 75 || level.teamBp >= 75)
    That's just a coding fix btw so it ends on 75 for sure.

    0 Not allowed! Not allowed!

    "Sense is not made like money, sense is had like heart, pride, and integrity."~Russ

  7. #7
    PS3 Modder
    PS3 Sniper

    Join Date
    Aug 2011
    Posts
    717
    Points
    317
         User Info     Contact     Gamer ID
    Join Date
    Aug 2011
    Posts
    717
    Points
    317
    Gamer IDs

    PSN ID: xMATRIX_22x

    Contact info:

    Youtube Channel: http://www.youtube.com/ItzMatriix

    Default

    well, cheese is right bout what he said, but with the variable thing, that would not give back unknown function. that would say uninitialized variable

    0 Not allowed! Not allowed!
    http://www.youtube.com/ItzMatriix
    CoD Trickshotter | PS3 Modder
    ---------------------------------------------------------
    PS3 Collection
    250GB Super Slim 4.60 OFW
    320GB Slim 4.50ITA DEX CFW

  8. #8
    Member M1lkdud's Avatar
    Join Date
    Jul 2012
    Posts
    72
    Points
    151
         User Info     Contact     Gamer ID
    Join Date
    Jul 2012
    Posts
    72
    Points
    151
    Gamer IDs

    PSN ID: Moneydud1

    Contact info:

    Youtube Channel: www.youtube.com/user/SKSMarineEcho

    Default

    Kazza, do us ALL a favor and Shut the fuck up all you do is bitch bitch bitch unless someone agrees with you, ive read your post, you fucking suck bro, if you wanna help me thats fine, but dont be walking in here looking like a badass saying"oh it aint this, its that, but i wont tell you how to fix it", or telling that the way the thing may be fixed is wrong.STFU!!!!!!!!!!!!!!!!!!!!!!!!

    0 Not allowed! Not allowed!

  9. #9
    MonsterCat
    Insan3Lik3
    CheeseToast's Avatar
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169
         User Info     Contact     Gamer ID
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169

    Contact info:

    Youtube Channel: http://www.youtube.com/CheeseToastHax

    Default

    Quote Originally Posted by xMATRIX_22x View Post
    well, cheese is right bout what he said, but with the variable thing, that would not give back unknown function. that would say uninitialized variable
    Hmm.. I guess your right.

    Quote Originally Posted by Coexist View Post
    Cheese covered it pretty much. And btw it should be
    if( level.teamAp >= 75 || level.teamBp >= 75)
    That's just a coding fix btw so it ends on 75 for sure.
    That's a waste of code. Why do more then or equal to 75 when you can do more then 74? It saves code.

    Oh, and just a tip.. add this:

    to addPoints()

    that saved coding cause you don't need "level"


    Code:
    flag = spawn( "script_model", (4121,1314,358) ); 
    flag setModel( "mp_flag_neutral" ); 
    flag.angles = (0,0,0);

    0 Not allowed! Not allowed!
    Last edited by CheeseToast; 01-29-2013 at 08:27 AM.
    "It's better to lose an argument/debate then to win. Cause when you lose you grow as a person."
    -CheeseToast

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 09:58 PM.
Powered by vBulletin®
Copyright © 2018 vBulletin Solutions, Inc. All rights reserved.