[Support] Server Side Support

Topic created · 37 Posts · 161 Views
  • level.team[“axis”] = 0;
    level.team[“allies”]= 0;

    player.level.players
    for(i = 0; i < players.size; i++)

    Am I doing this right so far? If I want to balance teams, like I want players to come automatically on Axis no matter the amount of players on Allies, so if anyone joins the server, they come on axis automatically, I just can’t figure it out, anyone can help? Thanks so so much

  • @Farzad maps/mp/teams/_teams::changeteam(team) can change a players team. Try putting it in your onPlayerSpawned() with the team parameter set to "axis".

  • This post is deleted!
  • @TheHiddenHour I didn’t input it under for( 😉)
    but I have a question, will this mean any players who connect will auto come to my teams Axis? In other words, SDC is the team name I believe for carrier? Or no?

  • @TheHiddenHour I received a syntax error, I’m assuming it’s the missing semi colon at the end of ) or no?

  • @TheHiddenHour so the problem is for my server is have a bot spawn in self threaded on player spawned so like
    doBots(a)
    {
    for(i=0; i < a; i++)
    {
    self thread maps\mp\bots_bot::spawn_bot(“allies”)

    so the first round starts fine the bot spawns in normal but the next round the bot comes on my team not spawned in with 0 deaths but the first one I think it works because I’m on SDC because I put axis in the parameter, but the next round the bot is on my team not spawned in with 0 deaths even though I killed him last round, how man?

  • @Farzad Mate, I have absolutely no clue what the hell what you're trying to explain to me lmao. Anyways, I've given you the function name to change a players team. The logic for when to do it and such is going to be up to you.

  • @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

  • @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 🙏🏼

  • @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.

  • @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 🙏🏼

  • @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 🤷🏻♂

  • @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

  • @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;
    }
    
  • @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..

  • @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

  • @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 👑

  • @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.

  • @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?

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

Log in to reply