SA-MP Forums Archive
Find how many players have a certain variable? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Find how many players have a certain variable? (/showthread.php?tid=383240)



Find how many players have a certain variable? - NewerthRoleplay - 06.10.2012

Hey, I have a variable which determines what team the player is on. However I want to have a max player cap for that group so that when a player joins if there is already 2 people it will automatically set the player to the other team.

What I mean by this is: Player Joins server, there is already 2 players in the attacking team, so they are automatically set as the other team

It's kind of confusing, I found it confusing writing it ^^

Many Thanks, Connor.


Re: Find how many players have a certain variable? - OnlyOne - 06.10.2012

2 variable to count how many players are in both teams,1 variable to set them to that team. Work over onplayerrequestclass and onplayerdisconnect to get down the numbers of players.

Try figute out by yourself.