06.12.2010, 18:35
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 ;)
}