Quote:
Originally Posted by Mauzen
You can simple count how many players are spawned with a loop, then divide it by the players that are online:
pawn Код:
// Get the amount of online players first new onlineplayers = 0; for(new i = 0; i < MAX_PLAYERS; i ++) { if(IsPlayerConnected(i)) onlineplayers ++; }
new counter = 0; for(new i = 0; i < MAX_PLAYERS; i ++) { if(IsPlayerSpawned(i)) counter ++; // Replace IsPlayerSpawned with the method you use to check it } if((float(counter) / float(onlineplayers)) > 0.5) { // More than 50% spawned, do something cool here ;) }
|
I never knew how to use the counts and i learnt everything from this little post,thanks