Posts: 254
Threads: 6
Joined: Nov 2013
Reputation:
0
Its not hard to use the search method in the fourms
Posts: 3,004
Threads: 12
Joined: May 2011
@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;
}