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.0k 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.
  • Farzadundefined Farzad

    TheHiddenHour okay well how come for some odd reason the next round the bot is not spawned in and is in my team? But the first round it’s all well

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

    Farzad said in Server Side Support:

    TheHiddenHour okay well how come for some odd reason the next round the bot is not spawned in and is in my team? But the first round it’s all well

    Farzad said in Server Side Support:

    TheHiddenHour I mean I would give you the compiled gsc to test it, but according to the discord image you sent regarding your PC specs, it ain’t lookin you finna hop on bo2 ma baby, but I just need help man plz 🙏🏼

    I'm not sure why the bot switches teams, but you can do a check to see how many bots are on a team and then kick them accordingly to keep the teams balanced.

    Farzadundefined 2 Replies Last reply
    0
    • TheHiddenHourundefined TheHiddenHour

      Farzad said in Server Side Support:

      TheHiddenHour okay well how come for some odd reason the next round the bot is not spawned in and is in my team? But the first round it’s all well

      Farzad said in Server Side Support:

      TheHiddenHour I mean I would give you the compiled gsc to test it, but according to the discord image you sent regarding your PC specs, it ain’t lookin you finna hop on bo2 ma baby, but I just need help man plz 🙏🏼

      I'm not sure why the bot switches teams, but you can do a check to see how many bots are on a team and then kick them accordingly to keep the teams balanced.

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

      TheHiddenHour please don’t mate me on this, but could you from the top of your head, just write a quick check, I do have a check of only 1 bot spawning in for the whole SnD game, but just after the next round he comes on my team not spawned it, im not basing my issue off bot count, the line you sent me works, but only for the first round, why is that? May you please like let me know, thanks man 🙏🏼

      1 Reply Last reply
      0
      • TheHiddenHourundefined TheHiddenHour

        Farzad said in Server Side Support:

        TheHiddenHour okay well how come for some odd reason the next round the bot is not spawned in and is in my team? But the first round it’s all well

        Farzad said in Server Side Support:

        TheHiddenHour I mean I would give you the compiled gsc to test it, but according to the discord image you sent regarding your PC specs, it ain’t lookin you finna hop on bo2 ma baby, but I just need help man plz 🙏🏼

        I'm not sure why the bot switches teams, but you can do a check to see how many bots are on a team and then kick them accordingly to keep the teams balanced.

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

        TheHiddenHour basically when the game starts I’m obviously on one team and he’s on another, to the players that join, how would I make them come to my team automatically? Using your line, it bugged out I guess next round, the first round started and I was on axis and he was on allies, but the next round he came to axis (my team) with 0 deaths and wasn’t spawned in, even though I did kill him last round, so what’s restarting in my script then? Do I need something called Waittill or something or no? Sorry for the spam I just need to fix this issue ASAP 🤷🏻‍♂️

        Farzadundefined 1 Reply Last reply
        0
        • Farzadundefined Farzad

          TheHiddenHour basically when the game starts I’m obviously on one team and he’s on another, to the players that join, how would I make them come to my team automatically? Using your line, it bugged out I guess next round, the first round started and I was on axis and he was on allies, but the next round he came to axis (my team) with 0 deaths and wasn’t spawned in, even though I did kill him last round, so what’s restarting in my script then? Do I need something called Waittill or something or no? Sorry for the spam I just need to fix this issue ASAP 🤷🏻‍♂️

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

          Farzad I’m waiting for one of those admins to come in randomly with the whole function done 😂, I wish I’m that person that it happens to, TheHiddenHour not saying anything wrong by the way

          TheHiddenHourundefined 1 Reply Last reply
          0
          • Farzadundefined Farzad

            Farzad I’m waiting for one of those admins to come in randomly with the whole function done 😂, I wish I’m that person that it happens to, TheHiddenHour not saying anything wrong by the way

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

            Farzad I'm playing some Warzone with my buds rn, sorry chief lol. I hope that admin comes soon though 👍 .

            EDIT: I can write this for you though.

            getTeamCount(team) {
            	count = 0;
            	foreach(player in level.players) {
            		if(player.team == team) {
            			count++;
            		}
            	}
            	
            	return count;
            }
            
            Farzadundefined 3 Replies Last reply
            0
            • TheHiddenHourundefined TheHiddenHour

              Farzad I'm playing some Warzone with my buds rn, sorry chief lol. I hope that admin comes soon though 👍 .

              EDIT: I can write this for you though.

              getTeamCount(team) {
              	count = 0;
              	foreach(player in level.players) {
              		if(player.team == team) {
              			count++;
              		}
              	}
              	
              	return count;
              }
              
              Farzadundefined Offline
              Farzadundefined Offline
              Farzad
              wrote on last edited by
              #15

              TheHiddenHour could you explain what this for me? I don’t see a word like Allies or Axis so I’m assuming I need to add some
              Stuff to the function, or is it already complete but I have to add the first line you sent me from the begging of this post followed up with that? Do I call anything? I’m sorry I’m not an expert at this..

              1 Reply Last reply
              0
              • TheHiddenHourundefined TheHiddenHour

                Farzad I'm playing some Warzone with my buds rn, sorry chief lol. I hope that admin comes soon though 👍 .

                EDIT: I can write this for you though.

                getTeamCount(team) {
                	count = 0;
                	foreach(player in level.players) {
                		if(player.team == team) {
                			count++;
                		}
                	}
                	
                	return count;
                }
                
                Farzadundefined Offline
                Farzadundefined Offline
                Farzad
                wrote on last edited by
                #16

                TheHiddenHour is this function tied with
                maps/mp/teams/_teams::changeteam(team)
                or is it not? Because I ask this because it says teams here and in the function it says Team without an S so like I’m confused on what to paste with the stuff you gave me sorry man

                1 Reply Last reply
                0
                • TheHiddenHourundefined TheHiddenHour

                  Farzad I'm playing some Warzone with my buds rn, sorry chief lol. I hope that admin comes soon though 👍 .

                  EDIT: I can write this for you though.

                  getTeamCount(team) {
                  	count = 0;
                  	foreach(player in level.players) {
                  		if(player.team == team) {
                  			count++;
                  		}
                  	}
                  	
                  	return count;
                  }
                  
                  Farzadundefined Offline
                  Farzadundefined Offline
                  Farzad
                  wrote on last edited by
                  #17

                  TheHiddenHour the line you provided and this function working but like man for some problem the Next Round Of The Game the bot just comes on us team and he isn’t spawned in, that’s all that the issue is, I know you wrote this function and are busy with a war zone match, hence it will take a bit of time for an answer, but please let me know what the best possible solution as I’ve been online all day looking on forums and sources and going inside the functions and not finding what I want, thanks man 👑

                  TheHiddenHourundefined 1 Reply Last reply
                  0
                  • Farzadundefined Farzad

                    TheHiddenHour the line you provided and this function working but like man for some problem the Next Round Of The Game the bot just comes on us team and he isn’t spawned in, that’s all that the issue is, I know you wrote this function and are busy with a war zone match, hence it will take a bit of time for an answer, but please let me know what the best possible solution as I’ve been online all day looking on forums and sources and going inside the functions and not finding what I want, thanks man 👑

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

                    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 1 Reply Last reply
                    0
                    • 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
                                          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