[Support] 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
-
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.
-
TheHiddenHour so, what else would I be missing apart from these?
-
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.
-
TheHiddenHour well how come I get kicked as soon as I try to connect to my server?
-
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.
-
TheHiddenHour well.. you know, the kick message, the most common one, “server disconnected- player has been kicked
-
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.
-
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
-
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.