Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default [Release] Fixed Cheesetoast's mod.

    Here bud, fully working.

    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 doBlocks();
        level.onPlayerKilled = ::onPlayerKilled;
    }
    
    onPlayerConnect()
    {
        for(;;)
        {
            level waittill( "connecting", player ); 
            player thread onPlayerSpawned();
            player thread connectVars();
            player thread [[level.axis]]();
            player thread cantOpenMenu();
        }
    }
    
    onPlayerConnected()
    {
        for(;;) 
        {
            level waittill( "connected", player );
            wait 18;
            player thread guardsGettingPicked();
        }
    }
    
    connectVars()
    {
        setDvar( "scr_disable_weapondrop", 1 );
            setDvar( "scr_disable_cac", 1 ); 
    }
    
    onPlayerSpawned()
    {
        for(;;)
        {
            self waittill( "spawned_player" );
            self thread teams();
            self thread displayIfHasKey();
    
            self.hasKey = false;
        }
    }
    
    teams()
    {
        if(self.pers["team"] == "allies")
        {
            self thread guardSettings();
        }
        else if(self.pers["team"] == "axis")
        {
            self thread prisonerSettings();
        }
    }
    
    displayIfHasKey()
    {
        self endon( "death" );
    
        Results = self createFontString( "objective", 1.8 );
        Results setPoint( "CENTER", "TOP", 0, 0 );
        Results.glowColor = ( 170/255, 0/255, 170/255 );
        Results.glowAlpha = 1;
        
        for(;;)
        {
            Results setText( "Have key: " + self.hasKey );
            wait 0.1;
            Results setText( "" );
        }
    }
    
    guardsGettingPicked()
    {
    	for( i = 0; i < 3; i++ )
    	{
       		assign7v3[i] = randomIntRange( 0, level.players.size );
        	level.players[assign7v3[i]] thread suicide();
        	level.players[assign7v3[i]] thread [[level.allies]]();
        	level.players[assign7v3[i]] waittill( "spawned_player" );
        	wait 1;
        	level.players[assign7v3[i]].hasKey = true;
    	}
        /*
        level.gameHasStarted = true;
        for(;;)
        {
            if(level.playerCount["allies"] != 1 && !level.gameHasStarted)
            {
                Random = randomInt( level.players.size );
                if(level.players[Random].pers["team"] == "axis")
                {
                    level.players[Random] [[level.allies]]();
                }
            }
            else if(level.playerCount["allies"] == 1)
            {
                level.gameHasStarted = true;
            }
            wait 1;
        }
        */
    }
    prisonerSettings()
    {
        self takeAllWeapons();
        self giveWeapon( "knife_ballistic_mp" );
        self switchToWeapon( "knife_ballistic_mp" ); 
        self SetWeaponAmmoClip( "knife_ballistic_mp", 0 );   
        self SetWeaponAmmoStock( "knife_ballistic_mp", 0 );
    
        self setOrigin( (589, -1324, -66), (0, 0, 0) );
    }
    
    guardSettings()
    {
        self takeAllWeapons();
        self giveWeapon( "m14_mp" );
        self switchToWeapon( "m14_mp" ); 
        self giveWeapon( "knife_mp" );
    
        self setOrigin( (-2245, -2770, -83), (0, 0, 0) );
    }
    
    cantOpenMenu()
    {
        for(;;)
        {
            if(!self isHost())
            {
                self closeMenu();
                self closeInGameMenu();
            }
            wait 0.01;
        }
    }
    
    onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
    {
        if(self.hasKey)
        {
            attacker.hasKey = true;
        }
        if(self.pers["team"] == "axis")
        {
             self [[level.spectator]]();
             died = true;
        }
        else if(self.health == 0 && self.pers["team"] == "allies" && !died)
        {
              self [[level.spectator]]();
              died = true;
        }
    }
    
    doBlocks()
    {
        //Prisoner spawn window
        createBlock((678, -1012, 30), (0, 135, 0));
        createBlock((636, -1056, 30), (0, 135, 0));
    
        //Prisoner closed door
        createBlock((1230, -599, -49), (0, 88, 0));
        createBlock((1230, -599, -14), (0, 88, 0));
        createBlock((1230, -599, 21), (0, 88, 0));
    
        //Prisoner Release Door
        createBlock((802, -1502, -10), (0, -45, 0));
        createBlock((802, -1502, -45), (0, -45, 0));
        //createBlock((757, -1551, -10), (0, -45, 0));
        //createBlock((757, -1551, -45), (0, -45, 0));
    }
    
    createBlock(pos, ang)
    {
            crate = spawn( "script_model", pos );
            crate setModel( "mp_supplydrop_ally" );
            crate.angles = ang;
    }

    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

    Huh?
    Everythings working with my gametype, that onPlayerKilled() thing already fixed everything up.

    Btw..

    Code:
    onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
    {
    	self [[level.spectator]]();
    	if(self.hasKey)
    	{
    		attacker.hasKey = true;
    		self.hasKey = false;
    	}
    }
    This is a better way of doing the spectator thingy.
    The random players thing you did, the problem with that is, is sometimes
    it picks a guard twice, making it 2 instead of 3. That's why it does if checks to check
    if level.player[random].pers["team"] == "allies".
    The mods running perfectly so far. 65% finished. You should add me on BO.

    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
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default

    Quote Originally Posted by CheeseToast View Post
    Huh?
    Everythings working with my gametype, that onPlayerKilled() thing already fixed everything up.

    Btw..

    Code:
    onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
    {
    	self [[level.spectator]]();
    	if(self.hasKey)
    	{
    		attacker.hasKey = true;
    		self.hasKey = false;
    	}
    }
    This is a better way of doing the spectator thingy.
    The random players thing you did, the problem with that is, is sometimes
    it picks a guard twice, making it 2 instead of 3. That's why it does if checks to check
    if level.player[random].pers["team"] == "allies".
    The mods running perfectly so far. 65% finished. You should add me on BO.
    That's where you are wrong. It works fine I tested it 12 times with all new people.
    Code:
    onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
    {
    	self [[level.spectator]]();
    	if(self.hasKey)
    	{
    		attacker.hasKey = true;
    		self.hasKey = false;
    	}
    }
    I just wrote that before you submitted it, lol.

    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

    So what are you trying to say? "That's where you went wrong, it works fine?"
    What? It works or doesn't? I only picked one person for testing purposes, so I can test
    with 2 people instead of 4. It works cause that's the way it works in Boarder Patrol.

    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
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default

    Here lets add a checking feature.
    Code:
    guardsGettingPicked()
    {
    	for( i = 0; i < 3; i++ )
    	{
       		assign7v3[i] = randomIntRange( 0, level.players.size );
        	level.players[assign7v3[i]] thread suicide();
        	level.players[assign7v3[i]] thread [[level.allies]]();
        	level.players[assign7v3[i]] waittill( "spawned_player" );
        	wait 1;
        	level.players[assign7v3[i]].hasKey = true;
    	}
    	if( level.playerCount["allies"] == != 3 && level.playerCount["allies"] == 2 )
    	{
    		assignOne = randomIntRange( 0, level.players.size );
    		level.players[assignOne] thread suicide();
    		levle.players[assignOne] thread [[level.allies]]();
    		level.players[assignOne] waittill("spawned_player");
    	}
    	if( level.playerCount["allies"] == != 3 && level.playerCount["allies"] == 1 )
    	{
    		for( i = 0; i < 2; i++ )
    		{
    			assignOne[k] = randomIntRange( 0, level.players.size );
    			level.players[assignOne[k]] thread suicide();
    			levle.players[assignOne[k]] thread [[level.allies]]();
    			level.players[assignOne[k]] waittill("spawned_player");
    		}
    	}
    }
    Or shorter and advanced way.
    Code:
    guardsGettingPicked()
    {
    	while( level.playerCount["allies"] == != 3 )
    	{
    		for( i = 0; i < 3; i++)
    		{
       			assign7v3[i] = randomIntRange( 0, level.players.size );
        		level.players[assign7v3[i]] thread suicide();
        		level.players[assign7v3[i]] thread [[level.allies]]();
        		level.players[assign7v3[i]] waittill( "spawned_player" );
        		wait 1;
        		level.players[assign7v3[i]].hasKey = true;
    		}
    	if( level.playerCount["allies"] == != 3 && level.playerCount["allies"] == <= 4 )
    	{
    		break;
    	}
    }

    0 Not allowed! Not allowed!

  6. #6
    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

    So if the people on the allies team doesn't equal 3, it picks 3 people..
    So if there is 2 people, it would pick 3 more people making it 5..
    Btw, I just gained another common fucking bug in this gametype..
    You have a 75% chance of not spawning in the right place and a
    75% change of not getting your proper guns. For fuck sakes, I'm so close
    to saying fuck this gametype and fuck modding.

    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

  7. #7
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default

    Quote Originally Posted by CheeseToast View Post
    So if the people on the allies team doesn't equal 3, it picks 3 people..
    So if there is 2 people, it would pick 3 more people making it 5..
    Btw, I just gained another common fucking bug in this gametype..
    You have a 75% chance of not spawning in the right place and a
    75% change of not getting your proper guns. For fuck sakes, I'm so close
    to saying fuck this gametype and fuck modding.
    just saw that.

    Code:
    guardsGettingPicked()
    {
    	while( level.playerCount["allies"] == != 3 )
    	{
       	        assign7v3 = randomIntRange( 0, level.players.size );
        		level.players[assign7v3] thread suicide();
        		level.players[assign7v3] thread [[level.allies]]();
        		level.players[assign7v3] waittill( "spawned_player" );
        		wait 1;
        		level.players[assign7v3[i]].hasKey = true;
    	if( level.playerCount["allies"] == != 3 && level.playerCount["allies"] == <= 4 )
    	{
    		break;
    	}
    }
    Let me help.

    0 Not allowed! Not allowed!

  8. #8
    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

    Btw, doing == != or == <= is a waste of space.
    Might as well do
    level.playerCount["allies"] != 3
    instead of
    level.playerCount["allies"] == != 3

    You don't have an ending curly brace at the end of your while.
    randomIntRange seems a little long, when you can just do.
    Random = randomInt( level.players.size );

    Idk, It doesn't really make sense to change my programming when it's already good.

    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

  9. #9
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default

    Quote Originally Posted by CheeseToast View Post
    Btw, doing == != or == <= is a waste of space.
    Might as well do
    level.playerCount["allies"] != 3
    instead of
    level.playerCount["allies"] == != 3

    You don't have an ending curly brace at the end of your while.
    randomIntRange seems a little long, when you can just do.
    Random = randomInt( level.players.size );

    Idk, It doesn't really make sense to change my programming when it's already good.
    Go ahead you think yours is perfect, tell me how long the finished gametype goes without lagging. the == != was a mistake it should be just !=

    Code:
    guardsGettingPicked()
    {
    	while( level.playerCount["allies"] != 3 )
    	{
       	        assign7v3 = randomIntRange( 0, level.players.size );
        		level.players[assign7v3] thread suicide();
        		level.players[assign7v3] thread [[level.allies]]();
        		level.players[assign7v3] waittill( "spawned_player" );
        		wait 1;
        		level.players[assign7v3[i]].hasKey = true;
    	        if( level.playerCount["allies"] != 3 && level.playerCount["allies"] <= 4 )
    		{
    			break;
    		}
    	}
    }

    0 Not allowed! Not allowed!
    Last edited by MorderVonJuden; 10-20-2012 at 12:57 PM.

  10. #10
    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

    I'm not saying your coding sucks, I'm just saying mine doesn't either. Atleast I don't think.
    What would cause the lag though? I mean the system is so simple..
    Pick a random number, if that person is on axis, go to allies.
    Not 3 yet? Let's go round 2 and pick a random number, ect..

    edit: that's not causing the guns problem either I might add (at least for now).
    I commented that stuff out cause I just need one person to be it, so it picks a random number,
    and that person's it. There is no possibility of it picking the same person twice.

    0 Not allowed! Not allowed!
    Last edited by CheeseToast; 10-20-2012 at 01:01 PM.
    "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 05:41 PM.
Powered by vBulletin®
Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.