simple implementation so that nomination count also is affected by playtime
This commit is contained in:
parent
5c0bc9340f
commit
5b62ad860f
@ -715,14 +715,25 @@ public Action Command_hours_average(int client, int args)
|
||||
if (IsValidClient(i) && !is_bot_player[i] && PM_IsPlayerSteam(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)",
|
||||
GetAveragePlayerTimeOnServer(),
|
||||
GetAveragePlayerTimeOnServerRTV(),
|
||||
GetPlayerWorthRTV_boost_(client),
|
||||
RoundToFloor((GetPlayerWorthRTV_boost_(client)/total_votes) * 100),
|
||||
nominate_worth,
|
||||
RoundToFloor((nominate_worth/total_votes) * 100),
|
||||
GetRtvPercentage(client));
|
||||
return Plugin_Handled;
|
||||
}
|
||||
@ -1056,7 +1067,13 @@ public Handle get_most_nominated_maps()
|
||||
GetArrayString(g_NominateList[i], j, map_iteration, PLATFORM_MAX_PATH);
|
||||
int nominate_count_for_particular_map = 0;
|
||||
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 strequal the map was nominated by a leader and most be forced on the vote.
|
||||
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])
|
||||
{
|
||||
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;
|
||||
count++;
|
||||
}
|
||||
@ -1598,7 +1620,6 @@ public void Handler_MapVoteFinished(Handle menu,
|
||||
if (IsValidClient(client) && !StrEqual(player_mapvote[client], ""))
|
||||
{
|
||||
//default intention is 1-5 votes, just like rtv.
|
||||
float vote_ammount = GetPlayerWorthRTV_boost_(client);
|
||||
int item_index = client_info[i][VOTEINFO_CLIENT_ITEM];
|
||||
static char map[PLATFORM_MAX_PATH];
|
||||
for(int j = 0; j < num_items; j++)
|
||||
@ -1611,7 +1632,13 @@ public void Handler_MapVoteFinished(Handle menu,
|
||||
}
|
||||
float value = 0.0;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
1729
mapchooser_extended/scripting/nominations_extended_avg.sp
Executable file
1729
mapchooser_extended/scripting/nominations_extended_avg.sp
Executable file
File diff suppressed because it is too large
Load Diff
@ -26,23 +26,24 @@
|
||||
{
|
||||
"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"
|
||||
{
|
||||
"#format" "{1:s},{2:s}"
|
||||
"en" "{1} has changed their nomination to {2}."
|
||||
}
|
||||
|
||||
"Nominate Title"
|
||||
{
|
||||
"en" "Nominate Map:"
|
||||
}
|
||||
"Nominate Title"
|
||||
{
|
||||
"#format" "{1:i}"
|
||||
"en" "Nominate Map: ({1} Nomination Boost)"
|
||||
}
|
||||
|
||||
"Can't Nominate Current Map"
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user