Limited players
#1

I got DM server...Allway it has got 70 players in grove street gang.So i need script for limited players in one gang like max players can be in one gang.
Reply
#2

I can't be extremely detailed since you haven't provided any code, but I would start by saving the number of members a gang has, and then checking how much members there are when someone tries to join the gang.
Then let the script send a message if the saved number is the maximal number, defined by you, so the player knows he has to join some other gang.
Reply
#3

Basically you need to make a new variable per-gang. So for example:

pawn Код:
new gangMembers_Grove;
Each time someone joins the grove gang, do this:

pawn Код:
gangMembers_Grove++;
That will increase the variable by one each time you do that code.

You will also want to run a check before performing the code above to see how many people are in the gang already. For example:

pawn Код:
if(gangMembers_Grove == MAX_MEMBERS_PER_GROUP)
If that variable is true, you'll want to make the player select a new group. Otherwise, let them join the group and add to the variable (the thing posted above).
Reply
#4

pawn Код:
new GroveStreetPlayers;

if(GroveStreetPlayers <= 20) GroveStreetPlayers++; //player tries to join, if grove players are under 20, make player in grove
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)