mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-11 22:24:33 +00:00
Vote% Logging
This commit is contained in:
parent
0941841a18
commit
73ee6d7072
2 changed files with 83 additions and 1 deletions
|
|
@ -85,6 +85,34 @@ function voteLog(%client, %typeName, %arg1, %arg2, %arg3, %arg4)
|
|||
}
|
||||
}
|
||||
|
||||
// votePercentLog(%client, %typeName, %key, %game.votesFor[%game.kickTeam], %game.votesAgainst[%game.kickTeam], %totalVotes, %game.totalVotesNone)
|
||||
// Info: Logs voting percent events
|
||||
function votePercentLog(%display, %typeName, %key, %voteYay, %voteNay, %voteTotal, %voteNone) //%voteNone = Did Not Vote (DNV)
|
||||
{
|
||||
if($Host::ClassicVoteLog)
|
||||
{
|
||||
// Dif calc for "VoteKickPlayer"
|
||||
if(%typeName $= "VoteKickPlayer")
|
||||
{
|
||||
%percent = mFloor((%voteYay/ClientGroup.getCount()) * 100);
|
||||
%voteNone = "N/A";
|
||||
%display = %typeName SPC "[" @ %display.nameBase @ "]";
|
||||
}
|
||||
else
|
||||
{
|
||||
%percent = mFloor((%voteYay/(ClientGroup.getCount() - %voteNone)) * 100);
|
||||
%display = %typeName SPC "[" @ %display @ "]";
|
||||
}
|
||||
|
||||
$VoteLog = "[" @ %key @ "]" SPC %display SPC "Yay[" @ %voteYay @ "] Nay[" @ %voteNay @ "] Total[" @ %voteTotal @ "] Vote%[" @ %percent @ "] DNV[" @ %voteNone @ "]";
|
||||
|
||||
// this is the info that will be logged
|
||||
%logpath = $Host::ClassicVoteLogPath;
|
||||
export("$VoteLog", %logpath, true);
|
||||
logEcho($VoteLog);
|
||||
}
|
||||
}
|
||||
|
||||
// From Goon
|
||||
// Slightly more elegant solution rather than spamming console
|
||||
function ClassicChatLog(%client, %id, %team, %msg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue