randoms
#1

How to make when player types like /dm it throws him randomly into red or blue team ( I WOULD LIKE A BALANCE EX: 3red ppl and 2blue ppl so he joins BLUE team) Can anyone pretty please give me an example??
Reply
#2

firstly there should be two teams. gTeam[MAX_PLAYERS] or something. then you could check if player is assigned to a team. if it returns to false make a check. if team1count > team2count set the player team to 2 and else set it to 1. if it is one use the fucntion 'random'. add a new value like new team = random(2); note that random starts counting from 0. in this case the value 'team' would be equal to either 1 or 0. and that should represent the team id. Or if you'd like it to be 1 or 2 do it like

new team = random(2)+1;

then the result would be 1 or 2. good luck!
Reply
#3

LT: Duok savo skype paaiskinsi man geriau as nelabai supratau.
EN: I didn't understand that can you give me your Skype name?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)