simple implementation so that nomination count also is affected by playtime

This commit is contained in:
jenz 2024-01-19 00:17:10 +01:00
parent 5c0bc9340f
commit 5b62ad860f
3 changed files with 1774 additions and 17 deletions

View File

@ -715,14 +715,25 @@ public Action Command_hours_average(int client, int args)
if (IsValidClient(i) && !is_bot_player[i] && PM_IsPlayerSteam(i)) if (IsValidClient(i) && !is_bot_player[i] && PM_IsPlayerSteam(i))
{ {
GetPlayerWorthRTV_(i); GetPlayerWorthRTV_(i);
total_votes += GetPlayerWorthRTV_boost_(i); float nominate_worth = GetPlayerWorthRTV_boost_(i);
if (nominate_worth < 1.0)
{
nominate_worth = 1.0;
}
total_votes += nominate_worth;
} }
} }
float nominate_worth = GetPlayerWorthRTV_boost_(client);
if (nominate_worth < 1.0)
{
nominate_worth = 1.0;
}
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 \n(%i%% mapvote) (%i%% rtv)", 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 \n(%i%% mapvote) (%i%% rtv)",
GetAveragePlayerTimeOnServer(), GetAveragePlayerTimeOnServer(),
GetAveragePlayerTimeOnServerRTV(), GetAveragePlayerTimeOnServerRTV(),
GetPlayerWorthRTV_boost_(client), nominate_worth,
RoundToFloor((GetPlayerWorthRTV_boost_(client)/total_votes) * 100), RoundToFloor((nominate_worth/total_votes) * 100),
GetRtvPercentage(client)); GetRtvPercentage(client));
return Plugin_Handled; return Plugin_Handled;
} }
@ -1056,7 +1067,13 @@ public Handle get_most_nominated_maps()
GetArrayString(g_NominateList[i], j, map_iteration, PLATFORM_MAX_PATH); GetArrayString(g_NominateList[i], j, map_iteration, PLATFORM_MAX_PATH);
int nominate_count_for_particular_map = 0; int nominate_count_for_particular_map = 0;
sm.GetValue(map_iteration, nominate_count_for_particular_map); sm.GetValue(map_iteration, nominate_count_for_particular_map);
nominate_count_for_particular_map++;
int nominate_worth = RoundToFloor(GetPlayerWorthRTV_boost_(i));
if (nominate_worth < 1)
{
nominate_worth = 1;
}
nominate_count_for_particular_map += nominate_worth;
//if i is 0 its admin nominated map that must come into the vote. //if i is 0 its admin nominated map that must come into the vote.
//if strequal the map was nominated by a leader and most be forced on the vote. //if strequal the map was nominated by a leader and most be forced on the vote.
if(!i || StrEqual(map_iteration, MapleaderNominatedMap, false)) if(!i || StrEqual(map_iteration, MapleaderNominatedMap, false))
@ -1406,7 +1423,12 @@ void InitiateVote(MapChange when, Handle inputlist=INVALID_HANDLE)
if (IsValidClient(i) && PM_IsPlayerSteam(i) && !is_bot_player[i]) if (IsValidClient(i) && PM_IsPlayerSteam(i) && !is_bot_player[i])
{ {
GetPlayerWorthRTV_(i); GetPlayerWorthRTV_(i);
player_mapvote_worth[i] = GetPlayerWorthRTV_boost_(i); float nominate_worth = GetPlayerWorthRTV_boost_(i);
if (nominate_worth < 1.0)
{
nominate_worth = 1.0;
}
player_mapvote_worth[i] = nominate_worth;
clients[count] = i; clients[count] = i;
count++; count++;
} }
@ -1598,7 +1620,6 @@ public void Handler_MapVoteFinished(Handle menu,
if (IsValidClient(client) && !StrEqual(player_mapvote[client], "")) if (IsValidClient(client) && !StrEqual(player_mapvote[client], ""))
{ {
//default intention is 1-5 votes, just like rtv. //default intention is 1-5 votes, just like rtv.
float vote_ammount = GetPlayerWorthRTV_boost_(client);
int item_index = client_info[i][VOTEINFO_CLIENT_ITEM]; int item_index = client_info[i][VOTEINFO_CLIENT_ITEM];
static char map[PLATFORM_MAX_PATH]; static char map[PLATFORM_MAX_PATH];
for(int j = 0; j < num_items; j++) for(int j = 0; j < num_items; j++)
@ -1611,7 +1632,13 @@ public void Handler_MapVoteFinished(Handle menu,
} }
float value = 0.0; float value = 0.0;
sm.GetValue(map, value); sm.GetValue(map, value);
value += vote_ammount;
float nominate_worth = GetPlayerWorthRTV_boost_(client);
if (nominate_worth < 1.0)
{
nominate_worth = 1.0;
}
value += nominate_worth;
sm.SetValue(map, value, true); sm.SetValue(map, value, true);
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -26,23 +26,24 @@
{ {
"en" "The map you chose has already been nominated." "en" "The map you chose has already been nominated."
} }
"Map Nominated"
{
"#format" "{1:s},{2:s}"
"en" "{1} has nominated {2}."
}
"Map Nominated"
{
"#format" "{1:s},{2:s},{3:i}"
"en" "{1} has nominated {2} ({3} Nomination Boost)."
}
"Map Nomination Changed" "Map Nomination Changed"
{ {
"#format" "{1:s},{2:s}" "#format" "{1:s},{2:s}"
"en" "{1} has changed their nomination to {2}." "en" "{1} has changed their nomination to {2}."
} }
"Nominate Title" "Nominate Title"
{ {
"en" "Nominate Map:" "#format" "{1:i}"
} "en" "Nominate Map: ({1} Nomination Boost)"
}
"Can't Nominate Current Map" "Can't Nominate Current Map"
{ {