07.12.2014, 04:26
@Abagail, it will return the current total players, not most players were online up until now
For this
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;
}