VoteSystem Redo (Goon Style)

A lot less code
Not a mess anymore
VoteHud support
Remove SetNextMission Elements
This commit is contained in:
ChocoTaco1 2020-04-03 10:47:27 -04:00
parent 2ca68a34d2
commit 6e9a4d4475
7 changed files with 925 additions and 1199 deletions

View file

@ -48,6 +48,7 @@ $Host::ClassicLoadSniperChanges = 0;
$Host::ClassicLoadTR2Gametype = 0;
$Host::ClassicLoadVRamChanges = 0;
$Host::ClassicLogEchoEnabled = 0;
$Host::ClassicMaxVotes = 5;
$Host::ClassicMaxTelepads = 3;
$Host::ClassicMOTD = "<color:3cb4b4><font:Sui Generis:22>Discord PUB\n<color:3cb4b4><font:Univers:16>Server Hosted/Provided by Branzone/Ravin\n<color:3cb4b4><font:Univers:16>Get Mappacks at https://playt2.com/";
$Host::ClassicMOTDLines = 3;

View file

@ -868,28 +868,31 @@ function DMGame::sendGameVoteMenu(%game, %client, %key)
%isAdmin = ( %client.isAdmin || %client.isSuperAdmin );
if(!%client.canVote && !%isAdmin)
return;
if ( %game.scheduleVote $= "" )
{
if(!%client.isAdmin)
{
if(!$Host::DMSLOnlyMode)
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'vote to enable Shocklance Only Mode', 'Vote to enable Shocklance Only Mode' );
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable SL Only Mode', 'Vote to enable Shocklance Only Mode' );
else
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'vote to disable Shocklance Only Mode', 'Vote to disable Shocklance Only Mode' );
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable SL Only Mode', 'Vote to disable Shocklance Only Mode' );
}
else if (%client.ForceVote > 0 && %client.NextMission !$= 1 ) //Added for SetNextMission
else if (%client.ForceVote > 0)
{
if(!$Host::DMSLOnlyMode)
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'vote to enable Shocklance Only Mode', 'Vote to enable Shocklance Only Mode' );
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable SL Only Mode', 'Vote to enable Shocklance Only Mode' );
else
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'vote to disable Shocklance Only Mode', 'Vote to disable Shocklance Only Mode' );
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable SL Only Mode', 'Vote to disable Shocklance Only Mode' );
}
else if ( %client.NextMission !$= 1 ) //Added for SetNextMission
else
{
if(!$Host::DMSLOnlyMode)
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'change to enable Shocklance Only Mode', 'Enable Shocklance Only Mode' );
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable SL Only Mode', 'Enable Shocklance Only Mode' );
else
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'change to disable Shocklance Only Mode', 'Disable Shocklance Only Mode' );
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable SL Only Mode', 'Disable Shocklance Only Mode' );
}
}
}

View file

@ -1088,7 +1088,7 @@ function LakRabbitGame::sendGameVoteMenu( %game, %client, %key )
//Added so lak vote items are properly displayed in evo adminvotemenu
//A lot of changes were added to admin.ovl in evo
//see footnotes below
else if (%client.ForceVote > 0 && %client.NextMission !$= 1 ) //Added for SetNextMission
else if (%client.ForceVote > 0)
{
if(!Game.duelMode)
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Vote to enable Duel Mode' );
@ -1105,7 +1105,7 @@ function LakRabbitGame::sendGameVoteMenu( %game, %client, %key )
else
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Disable Pro Mode', 'Vote to disable Pro Mode' );
}
else if ( %client.NextMission !$= 1 ) //Added for SetNextMission
else
{
if(!Game.duelMode)
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Enable Duel Mode' );

View file

@ -2260,9 +2260,12 @@ function SCtFGame::startFlagCollisionSearch(%game, %flag)
function SCtFGame::sendGameVoteMenu(%game, %client, %key)
{
parent::sendGameVoteMenu( %game, %client, %key );
parent::sendGameVoteMenu( %game, %client, %key );
%isAdmin = ( %client.isAdmin || %client.isSuperAdmin );
%isAdmin = ( %client.isAdmin || %client.isSuperAdmin );
if(!%client.canVote && !%isAdmin)
return;
if ( %game.scheduleVote $= "" )
{
@ -2271,23 +2274,23 @@ function SCtFGame::sendGameVoteMenu(%game, %client, %key)
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteArmorClass', 'change the armor class to', 'Vote to change the Armor class' );
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Vote Anti-Turtle time' );
if(!$Host::SCtFProMode)
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'vote to enable Pro Mode', 'Vote to enable Pro Mode' );
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode', 'Vote to enable Pro Mode' );
else
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'vote to disable Pro Mode', 'Vote to disable Pro Mode' );
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode', 'Vote to disable Pro Mode' );
}
else if (%client.ForceVote > 0 && %client.NextMission !$= 1 ) //Added for SetNextMission
else if (%client.ForceVote > 0)
{
if(!$Host::SCtFProMode)
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'vote to enable Pro Mode', 'Vote to enable Pro Mode' );
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode', 'Vote to enable Pro Mode' );
else
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'vote to disable Pro Mode', 'Vote to disable Pro Mode' );
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode', 'Vote to disable Pro Mode' );
}
else if ( %client.NextMission !$= 1 ) //Added for SetNextMission
else
{
if(!$Host::SCtFProMode)
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'change to enable Pro Mode', 'Enable Pro Mode' );
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode', 'Enable Pro Mode' );
else
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'change to disable Pro Mode', 'Disable Pro Mode' );
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode', 'Disable Pro Mode' );
}
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteArmorClass', 'change the armor class to', 'Change the Armor class' );
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Change Anti-Turtle time' );

File diff suppressed because it is too large Load diff

View file

@ -24,6 +24,15 @@ function VoteSound( %game, %typename, %arg1, %arg2 )
if(%arg1 $= "999") %arg1 = "unlimited";
messageAll('', '\c1Vote in Progress: \c0To change the time limit to %1. %2~wgui/objective_notification.wav', %arg1, %votemsg );
echo("Vote in Progress: To change the time limit to" SPC %arg1 @ ".");
case "VoteTournamentMode":
messageAll('', '\c1Vote in Progress: \c0To change the mission to Tournament Mode (%1). %3~wgui/objective_notification.wav', %arg1, %arg2, %votemsg );
echo("Vote in Progress: To change the mission to Tournament Mode" SPC "(" @ %arg1 @ ").");
case "VoteMatchStart":
messageAll('', '\c1Vote in Progress: \c0To start the match. %3~wgui/objective_notification.wav', %arg1, %arg2, %votemsg );
echo("Vote in Progress: To start the match.");
case "VoteFFAMode":
messageAll('', '\c1Vote in Progress: \c0To change the server to Free For All Mode. %3~wgui/objective_notification.wav', %arg1, %arg2, %votemsg );
echo("Vote in Progress: To change the server to Free For All Mode.");
case "VoteKickPlayer":
if(%arg1.team != 0 && Game.numTeams > 1) //Not observer
{
@ -47,9 +56,6 @@ function VoteSound( %game, %typename, %arg1, %arg2 )
else //Is observer
messageAll('', '\c1Vote in Progress: \c0To kick player %1. %2~wgui/objective_notification.wav', %arg1.nameBase, %votemsg );
echo("Vote in Progress: To kick player" SPC %arg1.nameBase SPC "(" @ %arg1.guid @ ").");
case "VoteTournamentMode":
messageAll('', '\c1Vote in Progress: \c0To change the mission to Tournament Mode (%1). %3~wgui/objective_notification.wav', %arg1, %arg2, %votemsg );
echo("Vote in Progress: To change the mission to Tournament Mode" SPC "(" @ %arg1 @ ").");
default:
messageAll('', '\c1Vote in Progress: \c0To %1. %2~wgui/objective_notification.wav', %arg1, %votemsg );
echo("Vote in Progress: To" SPC %arg1);

View file

@ -168,6 +168,7 @@ $Host::ClassicStatsType = 2;
$Host::ClassicViralBanning = 1;
$Host::ClassicWhitelist = "prefs/whitelist.cs";
$Host::ClassicSuppressTraversalRootError = 1;
$Host::ClassicMaxVotes = 5;
$Host::ServerRules1 = "\c2if\c4(\c3%client.fun == \c5true \c4&& \c3%client.Llama_Grabs \c4< \c51\c4)";
$Host::ServerRules2 = " \c1Be_Courteous\c4(\c2%client, %game\c4);";
$Host::ServerRules3 = "\c2else if\c4(\c3%client.attitude \c4!$ = \c5%client.fun\c4)";