Randomize a few players [+REP]
#10

Quote:
Originally Posted by Crayder
Посмотреть сообщение
I know his English isn't that easy to understand, but when your native language is English and you've been on this forum for years you start to understand this nonsense.

He doesn't want the balancing to random. He says "random" a lot, but that's not what he means. He also doesn't want to repeat the team ordering process over and over.
What you posted isn't a good alternative, as the order of joining isn't random but always the same. As it is an arena and assuming the players already know how it works, they would wait for players to join and become a zombie (with the balancing system on join), then they'll join so they can become a human. Because nobody wants to be a zombie with a chainsaw (implying it's like that, it commonly is).

What I posted should select random humans and random zombies, following:

if TotalCount == 2 then randomize 1 zombie
if TotalCount == 3 then randomize 1 zombie
if TotalCount == 4 then randomize 2 zombies
if TotalCount == 5 then randomize 2 zombies
if TotalCount == 6 then randomize 3 zombies
if TotalCount == 7 then randomize 3 zombies
if TotalCount == 8 then randomize 4 zombies

Without the possibility of selecting the same player again:
pawn Код:
selected = random(count);

pTeam[gPlayerIDs[selected]] = TEAM_ZOMBIE;

gPlayerIDs[selected] = gPlayerIDs[count - 1];

count --;
This part "gPlayerIDs[selected] = gPlayerIDs[count - 1];" also gives an extra random bonus to it and it's where the magic happens.

-------------------------------------------------------------------------------------

Regardless of what he actually wants, that is my interpretation of what I understood and the best way I saw fit. The code should only be ran once, and to an extent, he should use what you posted if any new players join after the teams have been sorted out.
Reply


Messages In This Thread
Randomize a few players [+REP] - by Lirbo - 23.07.2016, 22:26
Re: Randomize a few players [+REP] - by Threshold - 24.07.2016, 02:14
Re: Randomize a few players [+REP] - by WhiteGhost - 24.07.2016, 02:35
Re: Randomize a few players [+REP] - by Crayder - 24.07.2016, 02:43
Re: Randomize a few players [+REP] - by Threshold - 24.07.2016, 03:25
Re: Randomize a few players [+REP] - by SickAttack - 24.07.2016, 05:46
Re: Randomize a few players [+REP] - by Crayder - 24.07.2016, 06:17
Re: Randomize a few players [+REP] - by SickAttack - 24.07.2016, 07:01
Re: Randomize a few players [+REP] - by Crayder - 24.07.2016, 15:04
Re: Randomize a few players [+REP] - by SickAttack - 24.07.2016, 22:09

Forum Jump:


Users browsing this thread: 3 Guest(s)