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

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. [Support] Server Side Support

[Support] Server Side Support

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
38 Posts 4 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • TheHiddenHourundefined TheHiddenHour

    Farzad You're going to need to know some scripting knowledge mate. I've given you the means to switch a players team and get the amount of players on a team, now you need to write the logic. I'll even write you a function real quick that can kick players:

    kickPlayer() {
    	ent_num = self getEntityNumber();
    	kick(ent_num);
    }
    

    You can call it like self kickPlayer(); // Will kick the player who called the function
    I won't be writing something that you can C+P as that'd take a while. Hopefully a mod or someone else will help flesh it out for you.

    Farzadundefined Offline
    Farzadundefined Offline
    Farzad
    wrote on last edited by
    #19

    TheHiddenHour okay okay, but but why would I need to kick someone? I don’t have an issue with bot spawn in. Dude, the line works, the bot spawns in on the other team and all 5 of us spawn in on one team, not the bots team, but why next round the BOT comes to our team and isn’t spawned in? How is this kick function going to help?

    TheHiddenHourundefined 1 Reply Last reply
    0
    • Farzadundefined Farzad

      TheHiddenHour okay okay, but but why would I need to kick someone? I don’t have an issue with bot spawn in. Dude, the line works, the bot spawns in on the other team and all 5 of us spawn in on one team, not the bots team, but why next round the BOT comes to our team and isn’t spawned in? How is this kick function going to help?

      TheHiddenHourundefined Offline
      TheHiddenHourundefined Offline
      TheHiddenHour
      Contributor
      wrote on last edited by
      #20

      Farzad So you can kick the bot and spawn another one in. Again, no clue why it doesn't spawn in.

      Farzadundefined 1 Reply Last reply
      0
      • TheHiddenHourundefined TheHiddenHour

        Farzad So you can kick the bot and spawn another one in. Again, no clue why it doesn't spawn in.

        Farzadundefined Offline
        Farzadundefined Offline
        Farzad
        wrote on last edited by
        #21

        TheHiddenHour so, what else would I be missing apart from these?

        TheHiddenHourundefined 1 Reply Last reply
        0
        • Farzadundefined Farzad

          TheHiddenHour so, what else would I be missing apart from these?

          TheHiddenHourundefined Offline
          TheHiddenHourundefined Offline
          TheHiddenHour
          Contributor
          wrote on last edited by
          #22

          Farzad isPlayer(player); This will check if the player is a bot or not.
          Basically, you're going to want to follow these steps:

          • Iterate over every player when the round starts
          • Check if they're a bot
          • If they are, kick them
          • Spawn another bot to replace them
          foreach(player in level.players) {
          	if(!isPlayer(player)) { // Player is a bot
          		player kickPlayer();
          		// Spawn bot line here 
          	}
          }
          

          Something like this. You'll have to play around and experiment as I haven't tested it ofc.

          Farzadundefined 1 Reply Last reply
          0
          • TheHiddenHourundefined TheHiddenHour

            Farzad isPlayer(player); This will check if the player is a bot or not.
            Basically, you're going to want to follow these steps:

            • Iterate over every player when the round starts
            • Check if they're a bot
            • If they are, kick them
            • Spawn another bot to replace them
            foreach(player in level.players) {
            	if(!isPlayer(player)) { // Player is a bot
            		player kickPlayer();
            		// Spawn bot line here 
            	}
            }
            

            Something like this. You'll have to play around and experiment as I haven't tested it ofc.

            Farzadundefined Offline
            Farzadundefined Offline
            Farzad
            wrote on last edited by
            #23

            TheHiddenHour well how come I get kicked as soon as I try to connect to my server?

            TheHiddenHourundefined 1 Reply Last reply
            0
            • Farzadundefined Farzad

              TheHiddenHour well how come I get kicked as soon as I try to connect to my server?

              TheHiddenHourundefined Offline
              TheHiddenHourundefined Offline
              TheHiddenHour
              Contributor
              wrote on last edited by
              #24

              Farzad I don't know, what errors are you receiving? I'm almost done for the night so I'll be able to help you more in a bit.

              Farzadundefined 1 Reply Last reply
              0
              • TheHiddenHourundefined TheHiddenHour

                Farzad I don't know, what errors are you receiving? I'm almost done for the night so I'll be able to help you more in a bit.

                Farzadundefined Offline
                Farzadundefined Offline
                Farzad
                wrote on last edited by
                #25

                TheHiddenHour well.. you know, the kick message, the most common one, “server disconnected- player has been kicked

                TheHiddenHourundefined 1 Reply Last reply
                0
                • Farzadundefined Farzad

                  TheHiddenHour well.. you know, the kick message, the most common one, “server disconnected- player has been kicked

                  TheHiddenHourundefined Offline
                  TheHiddenHourundefined Offline
                  TheHiddenHour
                  Contributor
                  wrote on last edited by TheHiddenHour
                  #26

                  Farzad Ahh, that's probably from the bot check fucking up. Again, I didn't test it or anything. Just remove it for now, I'll help you in a little while.

                  Farzadundefined 1 Reply Last reply
                  0
                  • TheHiddenHourundefined TheHiddenHour

                    Farzad Ahh, that's probably from the bot check fucking up. Again, I didn't test it or anything. Just remove it for now, I'll help you in a little while.

                    Farzadundefined Offline
                    Farzadundefined Offline
                    Farzad
                    wrote on last edited by Farzad
                    #27

                    TheHiddenHour well you clearly can’t test it unfortunately based off your specs, though may you like try to write something else quickly or is that not possible? Sorry for like spamming you by the way

                    TheHiddenHourundefined 1 Reply Last reply
                    0
                    • Farzadundefined Farzad

                      TheHiddenHour well you clearly can’t test it unfortunately based off your specs, though may you like try to write something else quickly or is that not possible? Sorry for like spamming you by the way

                      TheHiddenHourundefined Offline
                      TheHiddenHourundefined Offline
                      TheHiddenHour
                      Contributor
                      wrote on last edited by
                      #28

                      Farzad I test on a CFW PS3 lol. Anyways, I wrote you something

                      init() {
                      	level.botsSpawned = false; // Whether bots have been spawned yet 
                      	level.botsAmount = 1; // Amount of bots to spawn 
                      }
                      
                      onPlayerSpawned() {
                      	for(;;) {
                      		self waittill("spawned_player");
                      		
                      		self thread switchTeam("axis"); // Move all players to axis team 
                      		
                      		if(!level.botsSpawned) {
                      			// Kick existing bots 
                      			foreach(player in level.players) {
                      				if(isAI(player)) { // Player is a bot 
                      					ent_num = player getEntityNumber(); // Get bot entity number 
                      					kick(ent_num); // Kick bot 
                      				}
                      			}
                      			
                      			// Spawn new bots 
                      			for(i = 0; i < level.botsAmount; i++) {
                      				level thread maps/mp/bots/_bot::spawn_bot("allies");
                      			}
                      			
                      			level.botsSpawned = true;
                      		}
                      	}
                      }
                      
                      switchTeam(team) {
                      	if ( self.sessionstate != "dead" ) {
                      		self.switching_teams = 1;
                      		self.joining_team = team;
                      		self.leaving_team = self.pers[ "team" ];
                      		// self suicide();
                      	}
                      	self.pers[ "team" ] = team;
                      	self.team = team;
                      	self.sessionteam = self.pers[ "team" ];
                      	if ( !level.teambased ) {
                      		self.ffateam = team;
                      	}
                      	self maps/mp/gametypes/_globallogic_ui::updateobjectivetext();
                      	self maps/mp/gametypes/_spectating::setspectatepermissions();
                      	// self setclientscriptmainmenu( game[ "menu_class" ] );
                      	// self openmenu( game[ "menu_class" ] );
                      	self notify( "end_respawn" );
                      }
                      

                      Give this a whack. Again, I didn't test, and if there's any problems then you're on your own since I really can't test atm. Sorry.

                      Farzadundefined 5 Replies Last reply
                      0
                      • TheHiddenHourundefined TheHiddenHour

                        Farzad I test on a CFW PS3 lol. Anyways, I wrote you something

                        init() {
                        	level.botsSpawned = false; // Whether bots have been spawned yet 
                        	level.botsAmount = 1; // Amount of bots to spawn 
                        }
                        
                        onPlayerSpawned() {
                        	for(;;) {
                        		self waittill("spawned_player");
                        		
                        		self thread switchTeam("axis"); // Move all players to axis team 
                        		
                        		if(!level.botsSpawned) {
                        			// Kick existing bots 
                        			foreach(player in level.players) {
                        				if(isAI(player)) { // Player is a bot 
                        					ent_num = player getEntityNumber(); // Get bot entity number 
                        					kick(ent_num); // Kick bot 
                        				}
                        			}
                        			
                        			// Spawn new bots 
                        			for(i = 0; i < level.botsAmount; i++) {
                        				level thread maps/mp/bots/_bot::spawn_bot("allies");
                        			}
                        			
                        			level.botsSpawned = true;
                        		}
                        	}
                        }
                        
                        switchTeam(team) {
                        	if ( self.sessionstate != "dead" ) {
                        		self.switching_teams = 1;
                        		self.joining_team = team;
                        		self.leaving_team = self.pers[ "team" ];
                        		// self suicide();
                        	}
                        	self.pers[ "team" ] = team;
                        	self.team = team;
                        	self.sessionteam = self.pers[ "team" ];
                        	if ( !level.teambased ) {
                        		self.ffateam = team;
                        	}
                        	self maps/mp/gametypes/_globallogic_ui::updateobjectivetext();
                        	self maps/mp/gametypes/_spectating::setspectatepermissions();
                        	// self setclientscriptmainmenu( game[ "menu_class" ] );
                        	// self openmenu( game[ "menu_class" ] );
                        	self notify( "end_respawn" );
                        }
                        

                        Give this a whack. Again, I didn't test, and if there's any problems then you're on your own since I really can't test atm. Sorry.

                        Farzadundefined Offline
                        Farzadundefined Offline
                        Farzad
                        wrote on last edited by
                        #29

                        TheHiddenHour will it give it a try, thanks for your help

                        1 Reply Last reply
                        0
                        • TheHiddenHourundefined TheHiddenHour

                          Farzad I test on a CFW PS3 lol. Anyways, I wrote you something

                          init() {
                          	level.botsSpawned = false; // Whether bots have been spawned yet 
                          	level.botsAmount = 1; // Amount of bots to spawn 
                          }
                          
                          onPlayerSpawned() {
                          	for(;;) {
                          		self waittill("spawned_player");
                          		
                          		self thread switchTeam("axis"); // Move all players to axis team 
                          		
                          		if(!level.botsSpawned) {
                          			// Kick existing bots 
                          			foreach(player in level.players) {
                          				if(isAI(player)) { // Player is a bot 
                          					ent_num = player getEntityNumber(); // Get bot entity number 
                          					kick(ent_num); // Kick bot 
                          				}
                          			}
                          			
                          			// Spawn new bots 
                          			for(i = 0; i < level.botsAmount; i++) {
                          				level thread maps/mp/bots/_bot::spawn_bot("allies");
                          			}
                          			
                          			level.botsSpawned = true;
                          		}
                          	}
                          }
                          
                          switchTeam(team) {
                          	if ( self.sessionstate != "dead" ) {
                          		self.switching_teams = 1;
                          		self.joining_team = team;
                          		self.leaving_team = self.pers[ "team" ];
                          		// self suicide();
                          	}
                          	self.pers[ "team" ] = team;
                          	self.team = team;
                          	self.sessionteam = self.pers[ "team" ];
                          	if ( !level.teambased ) {
                          		self.ffateam = team;
                          	}
                          	self maps/mp/gametypes/_globallogic_ui::updateobjectivetext();
                          	self maps/mp/gametypes/_spectating::setspectatepermissions();
                          	// self setclientscriptmainmenu( game[ "menu_class" ] );
                          	// self openmenu( game[ "menu_class" ] );
                          	self notify( "end_respawn" );
                          }
                          

                          Give this a whack. Again, I didn't test, and if there's any problems then you're on your own since I really can't test atm. Sorry.

                          Farzadundefined Offline
                          Farzadundefined Offline
                          Farzad
                          wrote on last edited by Farzad
                          #30
                          This post is deleted!
                          1 Reply Last reply
                          0
                          • TheHiddenHourundefined TheHiddenHour

                            Farzad I test on a CFW PS3 lol. Anyways, I wrote you something

                            init() {
                            	level.botsSpawned = false; // Whether bots have been spawned yet 
                            	level.botsAmount = 1; // Amount of bots to spawn 
                            }
                            
                            onPlayerSpawned() {
                            	for(;;) {
                            		self waittill("spawned_player");
                            		
                            		self thread switchTeam("axis"); // Move all players to axis team 
                            		
                            		if(!level.botsSpawned) {
                            			// Kick existing bots 
                            			foreach(player in level.players) {
                            				if(isAI(player)) { // Player is a bot 
                            					ent_num = player getEntityNumber(); // Get bot entity number 
                            					kick(ent_num); // Kick bot 
                            				}
                            			}
                            			
                            			// Spawn new bots 
                            			for(i = 0; i < level.botsAmount; i++) {
                            				level thread maps/mp/bots/_bot::spawn_bot("allies");
                            			}
                            			
                            			level.botsSpawned = true;
                            		}
                            	}
                            }
                            
                            switchTeam(team) {
                            	if ( self.sessionstate != "dead" ) {
                            		self.switching_teams = 1;
                            		self.joining_team = team;
                            		self.leaving_team = self.pers[ "team" ];
                            		// self suicide();
                            	}
                            	self.pers[ "team" ] = team;
                            	self.team = team;
                            	self.sessionteam = self.pers[ "team" ];
                            	if ( !level.teambased ) {
                            		self.ffateam = team;
                            	}
                            	self maps/mp/gametypes/_globallogic_ui::updateobjectivetext();
                            	self maps/mp/gametypes/_spectating::setspectatepermissions();
                            	// self setclientscriptmainmenu( game[ "menu_class" ] );
                            	// self openmenu( game[ "menu_class" ] );
                            	self notify( "end_respawn" );
                            }
                            

                            Give this a whack. Again, I didn't test, and if there's any problems then you're on your own since I really can't test atm. Sorry.

                            Farzadundefined Offline
                            Farzadundefined Offline
                            Farzad
                            wrote on last edited by
                            #31

                            TheHiddenHour I spawn in with the bot, and whenever I attempt to switch teams, I literally can’t, like I switch teams to seals but the moment I spawn in after switching team to seals I get switched back to the bots team which is sdc in other words axis, may you help like fix it? That’s the only issue, everything else is well 👍🏻

                            1 Reply Last reply
                            0
                            • TheHiddenHourundefined TheHiddenHour

                              Farzad I test on a CFW PS3 lol. Anyways, I wrote you something

                              init() {
                              	level.botsSpawned = false; // Whether bots have been spawned yet 
                              	level.botsAmount = 1; // Amount of bots to spawn 
                              }
                              
                              onPlayerSpawned() {
                              	for(;;) {
                              		self waittill("spawned_player");
                              		
                              		self thread switchTeam("axis"); // Move all players to axis team 
                              		
                              		if(!level.botsSpawned) {
                              			// Kick existing bots 
                              			foreach(player in level.players) {
                              				if(isAI(player)) { // Player is a bot 
                              					ent_num = player getEntityNumber(); // Get bot entity number 
                              					kick(ent_num); // Kick bot 
                              				}
                              			}
                              			
                              			// Spawn new bots 
                              			for(i = 0; i < level.botsAmount; i++) {
                              				level thread maps/mp/bots/_bot::spawn_bot("allies");
                              			}
                              			
                              			level.botsSpawned = true;
                              		}
                              	}
                              }
                              
                              switchTeam(team) {
                              	if ( self.sessionstate != "dead" ) {
                              		self.switching_teams = 1;
                              		self.joining_team = team;
                              		self.leaving_team = self.pers[ "team" ];
                              		// self suicide();
                              	}
                              	self.pers[ "team" ] = team;
                              	self.team = team;
                              	self.sessionteam = self.pers[ "team" ];
                              	if ( !level.teambased ) {
                              		self.ffateam = team;
                              	}
                              	self maps/mp/gametypes/_globallogic_ui::updateobjectivetext();
                              	self maps/mp/gametypes/_spectating::setspectatepermissions();
                              	// self setclientscriptmainmenu( game[ "menu_class" ] );
                              	// self openmenu( game[ "menu_class" ] );
                              	self notify( "end_respawn" );
                              }
                              

                              Give this a whack. Again, I didn't test, and if there's any problems then you're on your own since I really can't test atm. Sorry.

                              Farzadundefined Offline
                              Farzadundefined Offline
                              Farzad
                              wrote on last edited by Farzad
                              #32

                              TheHiddenHour okay basically i have team set to axis, never changed your script at all. For the map carrier, the team name for axis is SDC, when I first load into the server, I go into SDC, but the bot joins SDC he doesn’t join the parameter set which was Allies, and if I do attempt to switch teams I do go to allies which is seals but after I choose a class it auto switches back to axis (SDC) within half a second, I’ve spent a whole hour actually changing the script up, but I just can’t seem to find the flaw in it because my brain isn’t as complex as some of you, so may you just fix this up?

                              1 Reply Last reply
                              0
                              • TheHiddenHourundefined TheHiddenHour

                                Farzad I test on a CFW PS3 lol. Anyways, I wrote you something

                                init() {
                                	level.botsSpawned = false; // Whether bots have been spawned yet 
                                	level.botsAmount = 1; // Amount of bots to spawn 
                                }
                                
                                onPlayerSpawned() {
                                	for(;;) {
                                		self waittill("spawned_player");
                                		
                                		self thread switchTeam("axis"); // Move all players to axis team 
                                		
                                		if(!level.botsSpawned) {
                                			// Kick existing bots 
                                			foreach(player in level.players) {
                                				if(isAI(player)) { // Player is a bot 
                                					ent_num = player getEntityNumber(); // Get bot entity number 
                                					kick(ent_num); // Kick bot 
                                				}
                                			}
                                			
                                			// Spawn new bots 
                                			for(i = 0; i < level.botsAmount; i++) {
                                				level thread maps/mp/bots/_bot::spawn_bot("allies");
                                			}
                                			
                                			level.botsSpawned = true;
                                		}
                                	}
                                }
                                
                                switchTeam(team) {
                                	if ( self.sessionstate != "dead" ) {
                                		self.switching_teams = 1;
                                		self.joining_team = team;
                                		self.leaving_team = self.pers[ "team" ];
                                		// self suicide();
                                	}
                                	self.pers[ "team" ] = team;
                                	self.team = team;
                                	self.sessionteam = self.pers[ "team" ];
                                	if ( !level.teambased ) {
                                		self.ffateam = team;
                                	}
                                	self maps/mp/gametypes/_globallogic_ui::updateobjectivetext();
                                	self maps/mp/gametypes/_spectating::setspectatepermissions();
                                	// self setclientscriptmainmenu( game[ "menu_class" ] );
                                	// self openmenu( game[ "menu_class" ] );
                                	self notify( "end_respawn" );
                                }
                                

                                Give this a whack. Again, I didn't test, and if there's any problems then you're on your own since I really can't test atm. Sorry.

                                Farzadundefined Offline
                                Farzadundefined Offline
                                Farzad
                                wrote on last edited by
                                #33

                                TheHiddenHour since you can’t really test, I tried to explain the whole script error when joining the server as much as I can. I hope you understand, thanks man 🙏🏼

                                Cahzundefined 1 Reply Last reply
                                0
                                • Farzadundefined Farzad

                                  TheHiddenHour since you can’t really test, I tried to explain the whole script error when joining the server as much as I can. I hope you understand, thanks man 🙏🏼

                                  Cahzundefined Offline
                                  Cahzundefined Offline
                                  Cahz
                                  VIP
                                  wrote on last edited by
                                  #34

                                  Farzad if you are using the "change class mid game" script, it will cause bots to not spawn in on multiple rounds of SND because of this line

                                  self.pers[ "class" ] = undefined;
                                  

                                  if you called the script on a bot, their loadout for the next round is non-existent, thus they dont spawn in.

                                  As for the team changing issue, I have no idea what your code looks like, so i cannot say for sure how to fix.

                                  Farzadundefined 2 Replies Last reply
                                  0
                                  • Cahzundefined Cahz

                                    Farzad if you are using the "change class mid game" script, it will cause bots to not spawn in on multiple rounds of SND because of this line

                                    self.pers[ "class" ] = undefined;
                                    

                                    if you called the script on a bot, their loadout for the next round is non-existent, thus they dont spawn in.

                                    As for the team changing issue, I have no idea what your code looks like, so i cannot say for sure how to fix.

                                    Farzadundefined Offline
                                    Farzadundefined Offline
                                    Farzad
                                    wrote on last edited by Farzad
                                    #35

                                    Cahz Don’t thus me like that. I don’t have that line implemented in my functions, and the bot would still spawn in, but with no weapon i assume. Theirs no way he wouldn’t spawn in..

                                    1 Reply Last reply
                                    0
                                    • Cahzundefined Cahz

                                      Farzad if you are using the "change class mid game" script, it will cause bots to not spawn in on multiple rounds of SND because of this line

                                      self.pers[ "class" ] = undefined;
                                      

                                      if you called the script on a bot, their loadout for the next round is non-existent, thus they dont spawn in.

                                      As for the team changing issue, I have no idea what your code looks like, so i cannot say for sure how to fix.

                                      Farzadundefined Offline
                                      Farzadundefined Offline
                                      Farzad
                                      wrote on last edited by Farzad
                                      #36

                                      Cahz And I’ve resolved all issues thanks to a pal of mine on discord

                                      if your reading this, here’s this for you:

                                      for(😉)
                                      {
                                      ❤️
                                      }

                                      Farzadundefined 1 Reply Last reply
                                      0
                                      • Farzadundefined Farzad

                                        Cahz And I’ve resolved all issues thanks to a pal of mine on discord

                                        if your reading this, here’s this for you:

                                        for(😉)
                                        {
                                        ❤️
                                        }

                                        Farzadundefined Offline
                                        Farzadundefined Offline
                                        Farzad
                                        wrote on last edited by
                                        #37

                                        Cahz consider that heart an if statement because it doesn’t have a semi colon at the end of its parenthesis.

                                        1 Reply Last reply
                                        0
                                        • HUNTERXHUNTER444undefined Offline
                                          HUNTERXHUNTER444undefined Offline
                                          HUNTERXHUNTER444
                                          wrote on last edited by
                                          #38

                                          pliiz i cant connecte my acc on the plotunium application

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • 1
                                          • 2
                                          • Login

                                          • Don't have an account? Register

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