Posts: 193
Threads: 62
Joined: May 2012
Reputation:
0
Hello, i have a question how to check how much members are online from group/faction ?
I some to explain me.
I want when players types /mon it will says ex : 4 members online .
Thanks in advance.
Posts: 526
Threads: 52
Joined: Feb 2013
Reputation:
0
Make a variable to count a faction's online players and loop through all connected players when a player types /mon and check if they're in that faction, if they're raise the variable's value by one, after finishing the loop, format and send the player the desired message.
Posts: 193
Threads: 62
Joined: May 2012
Reputation:
0
Everytime when i invite myself in different faction its adding +150 members ..
i get this mesage
150 members online etc
Posts: 193
Threads: 62
Joined: May 2012
Reputation:
0
It still not works.. its only showining - 150 Members online...
Posts: 2,421
Threads: 52
Joined: Mar 2009
Reputation:
0
A better alternative would be to have a variable count how many players are in a team/faction when they join the team/faction. For example when you put a player in the cops team increase the "number_of_cops" var by one. When they log off reduce it by one. Then you always have access to the number of players in a team without looping through all players.