Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. MW3 Modding Support & Discussion
  3. Autoassign

Autoassign

Scheduled Pinned Locked Moved MW3 Modding Support & Discussion
6 Posts 3 Posters 163 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Former User? Offline
    A Former User? Offline
    A Former User
    wrote on last edited by
    #1

    Is there anyway / script available that when a player chooses a team it just auto assigns that player?
    I know in cod4x you can change code in the _menu.gsx file

    if( menu == game["menu_team"] )
    		{
    			switch(response)
    			{
    			case "allies":
    				self [[level.autoassign]]();  // changed from [[level.allies]]
    				break;
    
    				case "axis":
    				self [[level.autoassign]](); // changed from [[level.axis]]
    				break;
    
    			case "autoassign":
    				self [[level.autoassign]]();
    				break;
    
    			case "spectator":
    			self [[level.spectator]]();
    				break;
    			}
    

    Is there anything similar that can be done for MW3?

    1 Reply Last reply
    0
    • Resxtundefined Offline
      Resxtundefined Offline
      Resxt Plutonium Staff
      wrote on last edited by Resxt
      #2

      Wouldn't you prefer to not give the user choice at all and simply auto assign him when he joins?
      This can be done with a few lines that restrict team choice and the line that you gave that is correct [[level.autoassign]]();

      If you want to do that this script does just that

      Init()
      {
          InitTest();
      }
      
      InitTest()
      {
          replacefunc(maps\mp\_utility::allowTeamChoice, ::ReplaceAllowTeamChoice);
      
          level thread OnPlayerConnect();
      }
      
      OnPlayerConnect()
      {
          for(;;)
          {
              level waittill("connected", player); 
      
              player [[level.autoassign]]();
          }
      }
      
      ReplaceAllowTeamChoice()
      {	
      	return false;
      }
      
      1 Reply Last reply
      0
      • A Former User? Offline
        A Former User? Offline
        A Former User
        wrote on last edited by
        #3

        Thanks Resxt

        1 Reply Last reply
        0
        • A Former User? Offline
          A Former User? Offline
          A Former User
          wrote on last edited by A Former User
          #4

          Just one more thing....

          How once a player is autoassigned into the game can the player be stopped from changing team?

          Cheers

          MAD_DAD

          *** Done see post below ***

          FutureRaveundefined 1 Reply Last reply
          0
          • A Former User? Offline
            A Former User? Offline
            A Former User
            wrote on last edited by A Former User
            #5

            Ok did some tinkering and decided to set up a server players against bots.

            Your autoassign script works great on first joining.
            Now with the code I did(yours really helped me along). I now can stop a player from joining the bots team and gets put back to join the "Human" team.
            Here's the code:

            Init()
            {
               level thread OnPlayerConnect();
            }
            
            OnPlayerConnect()
            {
                for(;;)
                {
                    level waittill("connected", player); 
            	player thread OnPlayerSpawn();
                }
            }
            
            OnPlayerSpawn()
            {	
            	self endon ( "disconnect" );
            	while( 1 )
            	{
            	self waittill( "spawned_player" );
            	if(IsDefined( self.pers[ "isBot" ] ) && self.pers[ "isBot" ] )
            	return;
            	else
            	self thread ChangeTeam();
            	}
            }
            
            ChangeTeam()
            {
            	self endon ( "disconnect" );
            	if ( self.pers["team"] != "axis" )
            	return;
            	else
            	self iprintlnbold("^3>> ^2Do Not Join The BOTS! ^3<<");
            	wait 2;
            	self [[level.allies]]();
            	
            }
            

            Please feel free to scrutinise the code and point out where I could improve it

            Cheers
            MAD_DAD

            1 Reply Last reply
            0
            • FutureRaveundefined Offline
              FutureRaveundefined Offline
              FutureRave VIP
              replied to A Former User on last edited by
              #6

              MAD_DAD You need to override the _menus.gsc file and with that you will be able to prevent people from joining one team and force auto-assign real players to one team and keep bots to a separate team.
              The next Pluto release will have a built-in method "IsTestClient" you can use to differentiate between real players and bots.

              1 Reply Last reply
              0

              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Donate