further changes to show rtv boost correctly and display in percentage

This commit is contained in:
jenz
2023-09-12 21:20:16 +02:00
parent c09968a69d
commit 5808ec235d
2 changed files with 16 additions and 6 deletions
@@ -276,7 +276,12 @@ void AttemptRTV(int client)
if (g_Voted[client])
{
float rtv_worth = GetPlayerWorthRTV_boost_(client);
ReplyToCommand(client, "[RTVE] %t", "Already Voted", g_Votes, g_VotesNeeded, rtv_worth);
if (g_VotesNeeded == 0)
{
g_VotesNeeded = g_Votes;
}
int rtv_percentage_reached = RoundToFloor((float(g_Votes) / float(g_VotesNeeded)) * 100);
ReplyToCommand(client, "[RTVE] %t", "Already Voted", rtv_percentage_reached, "%", rtv_worth);
return;
}
@@ -293,7 +298,12 @@ void AttemptRTV(int client)
g_Voted[client] = true;
float rtv_worth = GetPlayerWorthRTV_boost_(client);
PrintToChatAll("[RTVE] %t", "RTV Requested", name, g_Votes, g_VotesNeeded, rtv_worth);
if (g_VotesNeeded == 0)
{
g_VotesNeeded = g_Votes;
}
int rtv_percentage_reached = RoundToFloor((float(g_Votes) / float(g_VotesNeeded)) * 100);
PrintToChatAll("[RTVE] %t", "RTV Requested", name, rtv_percentage_reached, "%", rtv_worth);
if (g_Votes >= g_VotesNeeded)
{