add peak player counter

This commit is contained in:
Damen 2019-04-09 21:50:45 -04:00
parent 50220121fc
commit 3a9d6127b9

View File

@ -198,6 +198,8 @@ public OnServerUpdateTimer( )
// better to store in a variable as we are getting the timestamp from hardware
g_iTime = gettime( );
UpdatePlayerCounters();
// for hooks
CallLocalFunction( "OnServerUpdate", "" );
@ -7083,3 +7085,18 @@ stock IsPlayerInArmyVehicle( playerid )
else
return false;
}
new playersPeakCount = 0;
stock UpdatePlayerCounters()
{
new total_online = Iter_Count( Player );
if ( total_online > playersPeakCount ) playersPeakCount = total_online;
}
CMD:peak( playerid, params[] )
{
if ( p_AdminLevel[ playerid ] != 6 ) return SendError( playerid, ADMIN_COMMAND_REJECT );
return SendClientMessageFormatted( playerid, -1, ""COL_PINK"[ADMIN]"COL_WHITE" The current peak player count since startup is: %i", playersPeakCount );
}