add peak player counter
This commit is contained in:
parent
50220121fc
commit
3a9d6127b9
@ -198,6 +198,8 @@ public OnServerUpdateTimer( )
|
|||||||
// better to store in a variable as we are getting the timestamp from hardware
|
// better to store in a variable as we are getting the timestamp from hardware
|
||||||
g_iTime = gettime( );
|
g_iTime = gettime( );
|
||||||
|
|
||||||
|
UpdatePlayerCounters();
|
||||||
|
|
||||||
// for hooks
|
// for hooks
|
||||||
CallLocalFunction( "OnServerUpdate", "" );
|
CallLocalFunction( "OnServerUpdate", "" );
|
||||||
|
|
||||||
@ -7083,3 +7085,18 @@ stock IsPlayerInArmyVehicle( playerid )
|
|||||||
else
|
else
|
||||||
return false;
|
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 );
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user