From fc2f5d6eb9109a5ddb8b443cfa24d46835ea9991 Mon Sep 17 00:00:00 2001 From: jenz Date: Sat, 30 Sep 2023 03:15:44 +0200 Subject: [PATCH] updated the avghour command to distinct between nomination average hour and the mapvote/rtv average hour and also shows the clients own mapvote/rtv boost plus percentage worth --- .../scripting/mapchooser_extended_avg.sp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mapchooser_extended/scripting/mapchooser_extended_avg.sp b/mapchooser_extended/scripting/mapchooser_extended_avg.sp index 37ca14dc..dee9649c 100755 --- a/mapchooser_extended/scripting/mapchooser_extended_avg.sp +++ b/mapchooser_extended/scripting/mapchooser_extended_avg.sp @@ -686,7 +686,20 @@ public Action Command_ReloadMaps(int client, int args) public Action Command_hours_average(int client, int args) { - CReplyToCommand(client, "Average hour count is: %i", GetAveragePlayerTimeOnServer()); + float total_votes = 0.0; + for (int i = 0; i < MaxClients; i++) + { + if (IsValidClient(i) && !is_bot_player[i] && PM_IsPlayerSteam(i)) + { + GetPlayerWorthRTV_(i); + total_votes += GetPlayerWorthRTV_boost_(i); + } + } + CReplyToCommand(client, "Average hour count for nominations is: %i \nAverage hour count for mapvote and rtv boost is: %i \nYour mapvote and rtv boost is %0.1f (%i%%)", + GetAveragePlayerTimeOnServer(), + GetAveragePlayerTimeOnServerRTV(), + GetPlayerWorthRTV_boost_(client), + RoundToFloor((GetPlayerWorthRTV_boost_(client)/total_votes) * 100)); return Plugin_Handled; }