Hello everyone!
I'm working on my programing skills and I can't find the solution to one of my problems. Here is what I want to do:
The map would be a RPG. There can be 6 players (red, orange, yellow, blue, purple and green). When there is only one player, that player gets kicked (no problem until now).
When there are two players, the system must check who are the actual players and for each of them, give control of 2 other uncontrolled players (at random I guess, but of course they must not control the same players). For example, if red and blue are playing, red gets control of green and yellow, blue gets control of orange and purple. I have no idea how I can do that, or I do but it's gonna be a huge mess of if then else if then else if then else... And I'm sure there must be a better way.
When there are 3 players, each of them gets control of another uncontrolled player, so the system is similar to the one before.
Nothing happens when there are 4 or more players (well... no problem with that part of course).
If anyone has a clue about the way I must solve this... Please tell me
Thank you for your answers people!
I'm working on my programing skills and I can't find the solution to one of my problems. Here is what I want to do:
The map would be a RPG. There can be 6 players (red, orange, yellow, blue, purple and green). When there is only one player, that player gets kicked (no problem until now).
When there are two players, the system must check who are the actual players and for each of them, give control of 2 other uncontrolled players (at random I guess, but of course they must not control the same players). For example, if red and blue are playing, red gets control of green and yellow, blue gets control of orange and purple. I have no idea how I can do that, or I do but it's gonna be a huge mess of if then else if then else if then else... And I'm sure there must be a better way.
When there are 3 players, each of them gets control of another uncontrolled player, so the system is similar to the one before.
Nothing happens when there are 4 or more players (well... no problem with that part of course).
If anyone has a clue about the way I must solve this... Please tell me
Thank you for your answers people!