Quote:
Originally Posted by Antithasys
Could you not hook a few events, like round start, round end, and change team.
That way if the round starts, and the players team variable is empty, then its a new map and load up the team variables. If the player changes team and the team event fires before the end of the round, then load up his new team in the variable. If the round end fires and then round start fires again, and the variables are not zero'd out, then you need to check teams and put everyone on the right team. You could also use the team index numbers (0,1,2,3,4) etc. instead of the signatures.
Like I said, I am sure there is a reason you are doing it the way you are, just wondering if the method I mentioned would work (if you tried it), and if not why.
I have a windows server so if this method worked, it would work for all.
|
I don't really understand your suggested method. In particular, "instead of the signatures." If you mean the SDKCall stuff, that's you can't use ChangeClientTeam() to move someone to survivor and have it do what you (probably) want. It won't "spawn" the player in or give them control of a survivor bot.
I don't use round_start or round_end because I only move people when the map begins. I just use OnMapStart to start team checking/fixing and player_team to store teams. I might end up using round_end to fix the problem ChillyWI is experiencing.
If you're suggesting to just use an array indexed by client ID to store teams, then I didn't want to assume everyone will get the same client ID after a map change's disconnect/reconnect. So I track by SteamID.
Almost all the complexity is just edge cases and making it as invisible to random players as possible. If I waited for everyone to load in and did a big mass swap, it'd be easier, but I know random llamas will quit in fear ("OMG WTF HAPPND TIHS SERVAR SUCKS"). Same reason I don't freeze everyone like Chilly asked. Even if I explain in a chat message, people are dumb. And playing 4 on 3 is terrible.
Most of the work is deciding who to swap, and whom to swap them with.
I'm not saying my code doesn't suck, though.