[FilterScript] mostplayeronline
#6

@Abagail, it will return the current total players, not most players were online up until now

For this
pawn Код:
// Create two arrays holding numbers, starting with0
new g_MaxPlayerOnline = 0,
      g_TotalPlayerOnline = 0;
public OnPlayerConnect(playerid)
{
      // Total players online raise
      g_TotalPlayerOnline ++;
      // if there are more players online *now* than it before then we or raise g_MaxPlayerOnline or set it to the same number which g_TotalPlayerOnline holds, which is also only 1 decimal far away, because only one player is connecting at this point.
      if(g_TotalPlayerOnline > g_MaxPlayerOnline)
      {
            g_MaxPlayerOnline = g_TotalPlayerOnline;
      }
      return true;
}
Reply


Messages In This Thread
mostplayeronline - by mamalzeus - 06.12.2014, 13:41
Re: mostplayeronline - by Alex Magaсa - 06.12.2014, 13:51
Re: mostplayeronline - by MohanedZzZ - 06.12.2014, 14:05
Re: mostplayeronline - by Ahammad - 06.12.2014, 14:10
Re: mostplayeronline - by Abagail - 07.12.2014, 03:03
Re: mostplayeronline - by Kaperstone - 07.12.2014, 04:26

Forum Jump:


Users browsing this thread: 1 Guest(s)