how to set a limit
#1

Hii ..
how to set a limit for people who want to enter a command?
..
like that only 10 Players are able to Join a Deatchmatch room.


LG Bearfist
Reply
#2

Create a variable which will count the amount of players who joined the deathmatch room and use it to check if the variable is equal to 10.
Reply
#3

Alright ... so I have to add:
Код:
new InDM;
InDM++;
in the loop of the Command ( for Example /EnterDM ) and Check if (InDM < 10) in the loop?
Otherwise it should be unable to join.

Is that Right ?
Reply
#4

The variable should be global and you don't need any loop.
Reply
#5

Okay.
Than I add
Код:
 
new InDM;
at the top of my script

and at the command /EnterDM: I add InDM++;

and if InDM > 2 the Player can't join the Deatchmatch

Is that right ?
Reply
#6

Correct.

You can use this way to check the limit:
pawn Код:
if(myVariable < 10)
{
  // player can join the deathmatch room.
}
else
{
  // player CAN'T join the deathmatch room.
}
Reply
#7

Thank you very much =)
It helped a lot.

LG Bearfist
Reply
#8

You're welcome.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)