Auto team balance script.
#1

Hi there!

Iґm about to create a team-balance-script. So new players cannot take a team which is more full then the others. Iґm done so far, but the last part is tricky.

When using OnPlayerRequestSpawn - how can I find out the team which the player wants to join?
Reply
#2

by the skinid
Reply
#3

Maybe I've not understood your question but to me the balancer does the work for you, you only get to select a team if they're not already balanced. You do the math on team counts then if they are not balanced use SetSpawnInfo & SpawnPlayer to skip class selection and set the player on the lower team, if they are balanced then you allow the class selection to happen.

Take a look at my post here, where I say "force" I mean SetSpawnInfo & SpawnPlayer, the code would go in OnPlayerRequestClass (class would be like team in the examples case). The random code is just there for an example, you could/would again allow them to pick the class instead of doing it for them unless you wanted it to be random obviously.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)