From 4989666d724defe0559ece5dcf0415eb318bac22 Mon Sep 17 00:00:00 2001 From: Maxime Leroy <19607336+maxime1907@users.noreply.github.com> Date: Sun, 30 Oct 2022 23:26:17 +0100 Subject: [PATCH] Add logging to all basevote vote results (#1794) --- plugins/basecommands/cancelvote.sp | 2 ++ plugins/basevotes.sp | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/basecommands/cancelvote.sp b/plugins/basecommands/cancelvote.sp index 167a1523..6a6faa3c 100644 --- a/plugins/basecommands/cancelvote.sp +++ b/plugins/basecommands/cancelvote.sp @@ -40,6 +40,8 @@ void PerformCancelVote(int client) } ShowActivity2(client, "[SM] ", "%t", "Cancelled Vote"); + + LogAction(client, -1, "\"%L\" Cancelled the vote.", client); CancelVote(); } diff --git a/plugins/basevotes.sp b/plugins/basevotes.sp index f19bd07a..bd2f4b67 100644 --- a/plugins/basevotes.sp +++ b/plugins/basevotes.sp @@ -298,11 +298,12 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa { /* :TODO: g_voteTarget should be used here and set to -1 if not applicable. */ - LogAction(-1, -1, "Vote failed."); + LogAction(-1, -1, "Vote failed. %d%% vote required. (Received \"%d\"% of %d votes)", RoundToNearest(100.0*limit), RoundToNearest(100.0*percent), totalVotes); PrintToChatAll("[SM] %t", "Vote Failed", RoundToNearest(100.0*limit), RoundToNearest(100.0*percent), totalVotes); } else { + LogAction(-1, -1, "Vote successful. (Received \"%d\"% of %d votes)", RoundToNearest(100.0*percent), totalVotes); PrintToChatAll("[SM] %t", "Vote Successful", RoundToNearest(100.0*percent), totalVotes); switch (g_voteType) @@ -313,7 +314,8 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa { strcopy(item, sizeof(item), display); } - + + LogAction(-1, -1, "The answer to %s is: %s.", g_voteArg, item); PrintToChatAll("[SM] %t", "Vote End", g_voteArg, item); }