Vote System Adjustments

A lot of changes
Stop vote fix
Set Next Mission Added
Description adjustments
Admin "Vote for..." In Tourney Mode
LCTF Pro Mode: Blaster >> Shocklance
This commit is contained in:
ChocoTaco1 2022-05-10 15:03:46 -04:00
parent 9e08e5c489
commit df06f0efcb
4 changed files with 591 additions and 475 deletions

View file

@ -838,26 +838,19 @@ function DMGame::sendGameVoteMenu(%game, %client, %key)
if(%game.scheduleVote $= "") if(%game.scheduleVote $= "")
{ {
if(!%client.isAdmin) if(!%isAdmin || (%isAdmin && %client.ForceVote))
{ {
if(!$Host::DMSLOnlyMode) if(!$Host::DMSLOnlyMode)
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable SL Only Mode', 'Vote to enable Shocklance Only Mode' ); messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable Shocklance Only Mode', 'Vote to enable Shocklance Only Mode' );
else else
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable SL Only Mode', 'Vote to disable Shocklance Only Mode' ); messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable Shocklance Only Mode', 'Vote to disable Shocklance Only Mode' );
}
else if (%client.ForceVote > 0)
{
if(!$Host::DMSLOnlyMode)
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable SL Only Mode', 'Vote to enable Shocklance Only Mode' );
else
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable SL Only Mode', 'Vote to disable Shocklance Only Mode' );
} }
else else
{ {
if(!$Host::DMSLOnlyMode) if(!$Host::DMSLOnlyMode)
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable SL Only Mode', 'Enable Shocklance Only Mode' ); messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Enable Shocklance Only Mode', 'Enable Shocklance Only Mode' );
else else
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable SL Only Mode', 'Disable Shocklance Only Mode' ); messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'Disable Shocklance Only Mode', 'Disable Shocklance Only Mode' );
} }
} }
} }

View file

@ -1172,42 +1172,20 @@ function LakRabbitGame::sendGameVoteMenu( %game, %client, %key )
if( %game.scheduleVote $= "" ) if( %game.scheduleVote $= "" )
{ {
if(!%isAdmin) if(!%isAdmin || (%isAdmin && %client.ForceVote))
{ {
if(!Game.duelMode) if(!Game.duelMode)
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Vote to enable Duel Mode' ); messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Vote to enable Duel Mode' );
else else
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Vote to disable Duel Mode' ); messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Vote to disable Duel Mode' );
if(!Game.noSplashDamage) if(!Game.noSplashDamage)
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Vote to disable Splash Damage' ); messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Vote to disable Splash Damage' );
else else
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Vote to enable Splash Damage' ); messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Vote to enable Splash Damage' );
// DeVast - PubPro votes if(!Game.PubPro) // DeVast - PubPro votes
if(!Game.PubPro) messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode (Disc, Blaster, Plasma Only)', 'Vote to enable Pro Mode (Disc, Blaster, Plasma Only)' );
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode', 'Vote to enable Pro Mode' );
else else
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Disable Pro Mode', 'Vote to disable Pro Mode' ); messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Disable Pro Mode (Disc, Blaster, Plasma Only)', 'Vote to disable Pro Mode (Disc, Blaster, Plasma Only)' );
}
//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)
{
if(!Game.duelMode)
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Vote to enable Duel Mode' );
else
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Vote to disable Duel Mode' );
if(!Game.noSplashDamage)
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Vote to disable Splash Damage' );
else
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Vote to enable Splash Damage' );
// DeVast - PubPro votes
if(!Game.PubPro)
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode', 'Vote to enable Pro Mode' );
else
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Disable Pro Mode', 'Vote to disable Pro Mode' );
} }
else else
{ {
@ -1215,16 +1193,14 @@ function LakRabbitGame::sendGameVoteMenu( %game, %client, %key )
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Enable Duel Mode' ); messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Enable Duel Mode', 'Enable Duel Mode' );
else else
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Disable Duel Mode' ); messageClient( %client, 'MsgVoteItem', "", %key, 'VoteDuelMode', 'Disable Duel Mode', 'Disable Duel Mode' );
if(!Game.noSplashDamage) if(!Game.noSplashDamage)
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Disable Splash Damage' ); messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Disable Splash Damage', 'Disable Splash Damage' );
else else
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Enable Splash Damage' ); messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSplashDamage', 'Enable Splash Damage', 'Enable Splash Damage' );
// DeVast - PubPro votes if(!Game.PubPro) // DeVast - PubPro votes
if(!Game.PubPro) messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode (Disc, Blaster, Plasma Only)', 'Enable Pro Mode (Disc, Blaster, Plasma Only)' );
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Enable Pro Mode', 'Enable Pro Mode' );
else else
messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Disable Pro Mode', 'Disable Pro Mode' ); messageClient( %client, 'MsgVoteItem', "", %key, 'VotePro', 'Disable Pro Mode (Disc, Blaster, Plasma Only)', 'Disable Pro Mode (Disc, Blaster, Plasma Only)' );
} }
} }
} }

View file

@ -495,7 +495,7 @@ function SCtFGame::equip(%game, %player)
{ {
%player.clearInventory(); %player.clearInventory();
%player.setInventory(Disc,1); %player.setInventory(Disc,1);
%player.setInventory(Blaster,1); %player.setInventory(Shocklance,1);
%player.setInventory(GrenadeLauncher,1); %player.setInventory(GrenadeLauncher,1);
%player.setInventory(DiscAmmo, %player.getDataBlock().max[DiscAmmo]); %player.setInventory(DiscAmmo, %player.getDataBlock().max[DiscAmmo]);
%player.setInventory(GrenadeLauncherAmmo, %player.getDataBlock().max[GrenadeLauncherAmmo]); %player.setInventory(GrenadeLauncherAmmo, %player.getDataBlock().max[GrenadeLauncherAmmo]);
@ -2216,28 +2216,21 @@ function SCtFGame::sendGameVoteMenu(%game, %client, %key)
if(%game.scheduleVote $= "") if(%game.scheduleVote $= "")
{ {
if(!%client.isAdmin) if(!%isAdmin || (%isAdmin && %client.ForceVote))
{ {
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteArmorClass', 'change the armor class to', 'Vote to change the Armor class' ); //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' ); //messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Vote Anti-Turtle time' );
if(!$Host::SCtFProMode) if(!$Host::SCtFProMode)
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode', 'Vote to enable Pro Mode' ); messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode (Disc, SL, GL Only)', 'Vote to enable Pro Mode (Disc, SL, GL Only)' );
else else
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode', 'Vote to disable Pro Mode' ); messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode (Disc, SL, GL Only)', 'Vote to disable Pro Mode (Disc, SL, GL Only)' );
}
else if (%client.ForceVote > 0)
{
if(!$Host::SCtFProMode)
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode', 'Vote to enable Pro Mode' );
else
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode', 'Vote to disable Pro Mode' );
} }
else else
{ {
if(!$Host::SCtFProMode) if(!$Host::SCtFProMode)
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode', 'Enable Pro Mode' ); messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Enable Pro Mode (Disc, SL, GL Only)', 'Enable Pro Mode (Disc, SL, GL Only)' );
else else
messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode', 'Disable Pro Mode' ); messageClient( %client, 'MsgVoteItem', "", %key, 'SCtFProMode', 'Disable Pro Mode (Disc, SL, GL Only)', 'Disable Pro Mode (Disc, SL, GL Only)' );
} }
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteArmorClass', 'change the armor class to', 'Change the Armor class' ); //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' ); //messageClient( %client, 'MsgVoteItem', "", %key, 'VoteAntiTurtleTime', 'change the anti turtle time to', 'Change Anti-Turtle time' );

View file

@ -10,6 +10,7 @@
//$Host::AllowPlayerVoteTournamentMode = 1; //$Host::AllowPlayerVoteTournamentMode = 1;
//$Host::AllowPlayerVoteTeamDamage = 0; //$Host::AllowPlayerVoteTeamDamage = 0;
//$Host::AllowPlayerTournamentModeVotekick = 0; //$Host::AllowPlayerTournamentModeVotekick = 0;
$Host::AllowPlayerVoteNextMission = 1;
//Vote Delay //Vote Delay
//Delay the ability to vote (For everyone) at the beginning of the match //Delay the ability to vote (For everyone) at the beginning of the match
@ -22,19 +23,41 @@
package ExtraVoteMenu package ExtraVoteMenu
{ {
function serverCmdGetVoteMenu( %client, %key )
{
if (isObject( Game ) && !%client.lockVMenu)
Game.sendGameVoteMenu( %client, %key );
%client.lockVMenu = 0;
}
function CycleMissions()
{
if($voteNext)
{
%nextMission = $HostMissionFile[$voteNextMap];
%type = $HostTypeName[$voteNextType];
messageAll( 'MsgClient', 'Loading %1 (%2)...', %nextMission, $HostTypeDisplayName[$voteNextType] );
loadMission( %nextMission, %type );
$voteNextType = 0;
$voteNextMap = 0;
$voteNext = 0;
}
else
parent::CycleMissions();
}
function DefaultGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4) function DefaultGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4)
{ {
switch$ (%typeName) switch$ (%typeName)
{ {
case "cancelMatchStart": case "cancelMatchStart":
%game.cancelMatchStart(%admin, %arg1, %arg2, %arg3, %arg4); %game.cancelMatchStart(%admin, %arg1, %arg2, %arg3, %arg4);
case "passRunningVote": case "passRunningVote":
%game.passRunningVote(%admin, %arg1, %arg2, %arg3, %arg4); %game.passRunningVote(%admin, %arg1, %arg2, %arg3, %arg4);
case "stopRunningVote": case "stopRunningVote":
%game.stopRunningVote(%admin, %arg1, %arg2, %arg3, %arg4); %game.stopRunningVote(%admin, %arg1, %arg2, %arg3, %arg4);
case "VoteNextMission":
%game.setNextMission(%admin, %arg1, %arg2, %arg3, %arg4);
default: default:
Parent::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4); Parent::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4);
} }
@ -44,22 +67,20 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key)
{ {
%isAdmin = (%client.isAdmin || %client.isSuperAdmin); %isAdmin = (%client.isAdmin || %client.isSuperAdmin);
%multipleTeams = %game.numTeams > 1; %multipleTeams = %game.numTeams > 1;
%client.k = %key; //For set next mission
// ********************************************
// Admin Vote For ... Submenu
// ********************************************
if (!$Host::TournamentMode)
{
if (%client.ForceVote > 0) if (%client.ForceVote > 0)
%client.ForceVote = %client.ForceVote - 1; %client.ForceVote = %client.ForceVote - 1;
//Admin Submenu
if (%client.ForceVote > 0) if (%client.ForceVote > 0)
{ {
if(!$Host::TournamentMode)
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'change server to Tournament.', 'Vote Tournament Mode'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'change server to Tournament.', 'Vote Tournament Mode');
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission');
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Vote to Set the Next Mission');
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit');
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Vote to Skip Mission' ); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Vote to Skip Mission' );
if(%multipleTeams) if(%multipleTeams)
{ {
if($teamDamage) if($teamDamage)
@ -67,20 +88,29 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key)
else else
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Vote to Enable Team Damage'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Vote to Enable Team Damage');
} }
messageClient(%client, 'MsgVoteItem',"", %key, 'ForceVote', 'Cancel Force Vote', "Cancel 'Vote To...'"); messageClient(%client, 'MsgVoteItem',"", %key, 'ForceVote', 'Cancel Force Vote', "Cancel 'Vote To...'");
return; // Display no further vote options return; // Display no further vote options
} }
//Pass Stop Menu
if(%client.isAdmin && %game.scheduleVote !$= "")
{
if(%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminStopVote)) // allow admins to stop votes
messageClient( %client, 'MsgVoteItem', "", %key, 'stopRunningVote', 'stop current vote', 'Stop the Vote');
if(%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminPassVote)) // allow admins to pass votes
messageClient( %client, 'MsgVoteItem', "", %key, 'passRunningVote', 'pass current vote', 'Pass the Vote');
return;
} }
//Mission Info Header - Mission Name, Type, Caps to Win //Mission Info Header - Mission Name, Type, Caps to Win
if(%client.canVote) if(%client.canVote && %game.scheduleVote $= "")
{ {
switch$($CurrentMissionType) switch$($CurrentMissionType)
{ {
case CTF or SCtF: case CTF or SCtF:
if($Host::TournamentMode) if($Host::TournamentMode)
%showTL = " - Time Limit:" SPC $Host::TimeLimit; %showTL = " - Time Limit:" SPC $Host::TimeLimit SPC "Minutes";
messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win", messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win",
$MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win" @ %showTL); $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win" @ %showTL);
case LakRabbit: case LakRabbit:
@ -101,7 +131,6 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key)
{ {
if(%multipleTeams) if(%multipleTeams)
messageClient(%client, 'MsgVoteItem', "", %key, 'ChooseTeam', "", 'Change your Team'); messageClient(%client, 'MsgVoteItem', "", %key, 'ChooseTeam', "", 'Change your Team');
if($MatchStarted) if($MatchStarted)
messageClient(%client, 'MsgVoteItem', "", %key, 'MakeObserver', "", 'Become an Observer'); messageClient(%client, 'MsgVoteItem', "", %key, 'MakeObserver', "", 'Become an Observer');
} }
@ -112,7 +141,6 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key)
{ {
if(%multipleTeams) if(%multipleTeams)
messageClient(%client, 'MsgVoteItem', "", %key, 'ChooseTeam', "", 'Change your Team'); messageClient(%client, 'MsgVoteItem', "", %key, 'ChooseTeam', "", 'Change your Team');
messageClient(%client, 'MsgVoteItem', "", %key, 'MakeObserver', "", 'Become an Observer'); messageClient(%client, 'MsgVoteItem', "", %key, 'MakeObserver', "", 'Become an Observer');
} }
} }
@ -133,8 +161,10 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key)
{ {
if(!$Host::TournamentMode) if(!$Host::TournamentMode)
{ {
if($Host::AllowPlayerVoteChangeMission) //if($Host::AllowPlayerVoteChangeMission) //Tourny Only for now
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission');
if($Host::AllowPlayerVoteNextMission)
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Vote to Set the Next Mission');
if($Host::AllowPlayerVoteTournamentMode) if($Host::AllowPlayerVoteTournamentMode)
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'Change server to Tournament.', 'Vote Tournament Mode'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'Change server to Tournament.', 'Vote Tournament Mode');
if($Host::AllowPlayerVoteTimeLimit) if($Host::AllowPlayerVoteTimeLimit)
@ -156,6 +186,8 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key)
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Vote to Start the Match'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Vote to Start the Match');
if($Host::AllowPlayerVoteChangeMission) if($Host::AllowPlayerVoteChangeMission)
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission');
if($Host::AllowPlayerVoteNextMission)
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Vote to Set the Next Mission');
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Vote Free For All Mode'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Vote Free For All Mode');
if($Host::AllowPlayerVoteTimeLimit) if($Host::AllowPlayerVoteTimeLimit)
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit');
@ -175,9 +207,12 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key)
{ {
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'Change server to Tournament.', 'Tournament Mode'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'Change server to Tournament.', 'Tournament Mode');
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Change the Mission'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Change the Mission');
if(!$voteNext)
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Set the Next Mission');
else
messageClient(%client, 'MsgVoteItem', "", %key, 'ClearNextMap', 'Clear Next Set Map', 'Clear Next Set Map');
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Skip the Mission' ); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Skip the Mission' );
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Change the Time Limit'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Change the Time Limit');
if(%multipleTeams) if(%multipleTeams)
{ {
if($teamDamage) if($teamDamage)
@ -185,7 +220,6 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key)
else else
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Enable Team Damage'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Enable Team Damage');
} }
if($Host::AllowAdminVotes) if($Host::AllowAdminVotes)
messageClient(%client, 'MsgVoteItem', "", %key, 'ForceVote', 'Vote to ...', 'Vote to ...'); messageClient(%client, 'MsgVoteItem', "", %key, 'ForceVote', 'Vote to ...', 'Vote to ...');
} }
@ -195,21 +229,23 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key)
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Start Match'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Start Match');
if(!$MatchStarted && $CountdownStarted) if(!$MatchStarted && $CountdownStarted)
messageClient(%client, 'MsgVoteItem', "", %key, 'cancelMatchStart', 'Cancel Match Start', 'Cancel Match Start'); messageClient(%client, 'MsgVoteItem', "", %key, 'cancelMatchStart', 'Cancel Match Start', 'Cancel Match Start');
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Change the Mission');
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Free For All Mode'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Free For All Mode');
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Change the Mission');
if(!$voteNext)
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Set the Next Mission');
else
messageClient(%client, 'MsgVoteItem', "", %key, 'ClearNextMap', 'Clear Next Set Map', 'Clear Next Set Map');
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Change the Time Limit'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Change the Time Limit');
if($Host::AllowAdminVotes)
messageClient(%client, 'MsgVoteItem', "", %key, 'ForceVote', 'Vote to ...', 'Vote to ...');
if($Host::Password !$= "") if($Host::Password !$= "")
messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Disable PUG Password', 'Disable PUG Password'); messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Disable PUG Password', 'Disable PUG Password');
else else
messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Enable PUG Password', 'Enable PUG Password'); messageClient(%client, 'MsgVoteItem', "", %key, 'TogglePUGpassword', 'Enable PUG Password', 'Enable PUG Password');
if($LockedTeams) if($LockedTeams)
messageClient(%client, 'MsgVoteItem', "", %key, 'ToggleLockedTeams', 'Disable Locked Teams', 'Disable Locked Teams'); messageClient(%client, 'MsgVoteItem', "", %key, 'ToggleLockedTeams', 'Disable Locked Teams', 'Disable Locked Teams');
else else
messageClient(%client, 'MsgVoteItem', "", %key, 'ToggleLockedTeams', 'Enable Locked Teams', 'Enable Locked Teams'); messageClient(%client, 'MsgVoteItem', "", %key, 'ToggleLockedTeams', 'Enable Locked Teams', 'Enable Locked Teams');
if(%multipleTeams) if(%multipleTeams)
{ {
if($teamDamage) if($teamDamage)
@ -233,14 +269,6 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key)
if ($Host::ServerRules[1] !$= "" ) if ($Host::ServerRules[1] !$= "" )
messageClient( %client, 'MsgVoteItem', "", %key, 'showServerRules', 'show server rules', "Show Server Rules" ); messageClient( %client, 'MsgVoteItem', "", %key, 'showServerRules', 'show server rules', "Show Server Rules" );
} }
else
{
if(%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminStopVote)) // allow admins to stop votes
messageClient( %client, 'MsgVoteItem', "", %key, 'stopRunningVote', 'stop current vote', 'Stop the Vote');
if(%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminPassVote)) // allow admins to pass votes
messageClient( %client, 'MsgVoteItem', "", %key, 'passRunningVote', 'pass current vote', 'Pass the Vote');
}
} }
// Eolk - completely re-wrote this. // Eolk - completely re-wrote this.
@ -250,16 +278,90 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %
if(!%client.canVote && !%isAdmin) if(!%client.canVote && !%isAdmin)
return; return;
if(Game.scheduleVote !$= "" && (!%isAdmin || (%isAdmin && %client.adminVoteSet))) if(Game.scheduleVote !$= "" && (!%isAdmin || (%isAdmin && %client.ForceVote)))
{ {
messageClient(%client, 'voteAlreadyRunning', "\c2A vote is already in progress."); messageClient(%client, 'voteAlreadyRunning', "\c2A vote is already in progress.");
%client.adminVoteSet = 0; %client.ForceVote = 0;
return; return;
} }
%teamSpecific = 0; %teamSpecific = 0;
switch$(%typeName) switch$(%typeName)
{ {
case "VoteNextMission":
%foundMap =0;
%client.lockVMenu = 1;
if(strpos(strlwr(%arg1),"next mission") != -1)
{
%key = %client.k++;
for ( %type = 0; %type < $HostTypeCount; %type++ )
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteNextMission', $HostTypeDisplayName[%type], $HostTypeDisplayName[%type], true );
return;
}
%key = %client.k++;
for ( %type = 0; %type < $HostTypeCount; %type++ )
{
if($HostTypeDisplayName[%type] $= %arg1)
{
$HostNextTypeIndex = %type;
for ( %i = $HostMissionCount[%type] - 1; %i >= 0; %i-- )
{
%idx = $HostMission[%type, %i];
// If we have bots, don't change to a mission that doesn't support bots:
if ( $HostGameBotCount > 0 )
{
if( !$BotEnabled[%idx] )
continue;
}
messageClient( %client, 'MsgVoteItem', "", %key,'VoteNextMission',$HostMissionName[%idx],$HostMissionName[%idx], true );
}
return;
}
}
%type = $HostNextTypeIndex;
for ( %i = $HostMissionCount[%type] - 1; %i >= 0; %i-- )
{
%idx = $HostMission[%type, %i];
if ( $HostGameBotCount > 0 )
{
if( !$BotEnabled[%idx] )
continue;
}
if(%arg1 $= $HostMissionName[%idx])
{
$hostNextMapIndex = %idx;
%foundMap = 1;
break;
}
}
//error("found map" SPC %foundMap SPC $HostNextTypeIndex SPC $hostNextMapIndex);
if(%foundMap)
{
%arg3 = $hostNextMapIndex;
%arg4 = $HostNextTypeIndex;
// Vote-spoof prevention right here
%arg1 = $HostMissionFile[%arg3];
%arg2 = $HostTypeName[%arg4];
if(!checkMapExist(%arg1, %arg2))
return;
// We passed the spoof check, give it the fancy label
%arg1 = $HostMissionName[%arg3];
%arg2 = $HostTypeDisplayName[%arg4];
%client.lockVMenu = 0;
if((!%isAdmin && $Host::AllowPlayerVoteNextMission) || (%isAdmin && %client.ForceVote)) // not admin
{
if($CMHasVoted[%client.guid] >= $Host::ClassicMaxVotes && !%isAdmin) // they've voted too many times
{
messageClient(%client, "", "\c2You have exhausted your voting rights for this mission.");
return;
}
%msg = %client.nameBase @ " initiated a vote to set the next mission to " @ %arg1 @ " (" @ %arg2 @ ").";
$CMHasVoted[%client.guid]++;
}
}
case "VoteKickPlayer": case "VoteKickPlayer":
if(%client == %arg1) // client is trying to votekick himself if(%client == %arg1) // client is trying to votekick himself
return; // Use the leave button instead, pal. return; // Use the leave button instead, pal.
@ -518,18 +620,26 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %
case "passRunningVote": case "passRunningVote":
if (%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminPassVote)) if (%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminPassVote))
{ {
adminStartNewVote( %client, %typename, %arg1, %arg2, %arg3, %arg4); passCurrentVote(%client);
adminLog(%client, " passed the vote in progress."); adminLog(%client, " passed the vote in progress.");
return;
} }
case "stopRunningVote": case "stopRunningVote":
if($VOStatus !$="InProgress" || $Host::TournamentMode) //Dont allow a stop vote after time has expired, then no new time is set - VoteOverTime
{
if(%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminStopVote)) if(%client.isSuperAdmin || (%client.isAdmin && $Host::AllowAdminStopVote))
{ {
adminStartNewVote(%client, %typename, %arg1, %arg2, %arg3, %arg4); if($VOStatus !$="InProgress") //Dont allow a stop vote after time has expired, then no new time is set - VoteOverTime
{
stopCurrentVote(%client);
adminLog(%client, " stopped the vote in progress."); adminLog(%client, " stopped the vote in progress.");
return;
} }
else
{
messageClient(%client, "", "\c2Can't stop time vote after time has expired.");
return;
}
} }
// LakRabbit Stuff // LakRabbit Stuff
@ -647,8 +757,12 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %
} }
return; return;
case "ForceVote": case "ForceVote":
if (%client.isAdmin && $Host::AllowAdminVotes) if (!%client.isAdmin)
{ return;
if(%client.isAdmin && !$Host::AllowAdminVotes)
return;
if (%client.ForceVote) if (%client.ForceVote)
{ {
%client.ForceVote = 0; %client.ForceVote = 0;
@ -659,6 +773,14 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %
%client.ForceVote = 2; %client.ForceVote = 2;
messageClient( %client, '', "Now select what to vote on, please." ); messageClient( %client, '', "Now select what to vote on, please." );
} }
return;
case "ClearNextMap":
if (%client.isAdmin && $voteNext)
{
messageAll('MsgAdminForce', "\c2The Admin " @ %client.nameBase @ " has cleared the next set mission.");
adminLog(%client, " has cleared the next set mission.");
$voteNext = 0;
} }
return; return;
@ -666,14 +788,13 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %
return; return;
} }
if(%isAdmin && !%client.adminVoteSet && !%client.ForceVote) if(%isAdmin && !%client.ForceVote)
adminStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4); adminStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4);
else else
playerStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg); playerStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg);
} }
//exec("scripts/autoexec/VoteMenu.cs"); //exec("scripts/autoexec/VoteMenu.cs");
function playerStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg) function playerStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg)
{ {
%clientsVoting = 0; %clientsVoting = 0;
@ -717,6 +838,8 @@ function playerStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %tea
{ {
case "VoteChangeMission": case "VoteChangeMission":
messageClient( %cl, 'VoteStarted', "\c2" @ %msg, %client.name, "change the mission to", %arg1, %arg2); messageClient( %cl, 'VoteStarted', "\c2" @ %msg, %client.name, "change the mission to", %arg1, %arg2);
case "VoteNextMission":
messageClient( %cl, 'VoteStarted', "\c2" @ %msg, %client.name, "set next mission to", %arg1, %arg2);
case "VoteSkipMission": case "VoteSkipMission":
messageClient( %cl, 'VoteStarted', "\c2" @ %msg, %client.name, "skip the mission"); messageClient( %cl, 'VoteStarted', "\c2" @ %msg, %client.name, "skip the mission");
case "VoteChangeTimeLimit": case "VoteChangeTimeLimit":
@ -883,6 +1006,7 @@ function DefaultGame::voteChangeMission(%game, %admin, %missionDisplayName, %typ
if(isObject(%admin)) if(isObject(%admin))
{ {
messageAll('MsgAdminChangeMission', '\c2The Admin %3 has changed the mission to %1 (%2).', %missionDisplayName, %typeDisplayName, %admin.name ); messageAll('MsgAdminChangeMission', '\c2The Admin %3 has changed the mission to %1 (%2).', %missionDisplayName, %typeDisplayName, %admin.name );
$voteNext = 0;
%game.gameOver(); %game.gameOver();
loadMission( %mission, %missionType, false ); loadMission( %mission, %missionType, false );
adminLog(%admin, " has changed the mission to " @ %missionDisplayName @ " (" @ %typeDisplayName @ ")"); adminLog(%admin, " has changed the mission to " @ %missionDisplayName @ " (" @ %typeDisplayName @ ")");
@ -901,6 +1025,7 @@ function DefaultGame::voteChangeMission(%game, %admin, %missionDisplayName, %typ
//Show Vote % //Show Vote %
messageAll('', '\c1Vote %6: \c0Yea: %1 Nay: %2 Abstain: %7 Total: %3 [%4%5]', %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, mfloor((%game.totalVotesFor/(ClientGroup.getCount() - %game.totalVotesNone)) * 100), "%", %key, %game.totalVotesNone); messageAll('', '\c1Vote %6: \c0Yea: %1 Nay: %2 Abstain: %7 Total: %3 [%4%5]', %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, mfloor((%game.totalVotesFor/(ClientGroup.getCount() - %game.totalVotesNone)) * 100), "%", %key, %game.totalVotesNone);
$voteNext = 0;
%game.gameOver(); %game.gameOver();
loadMission( %mission, %missionType, false ); loadMission( %mission, %missionType, false );
} }
@ -1346,27 +1471,6 @@ function DefaultGame::sendGamePlayerPopupMenu( %game, %client, %targetClient, %k
} }
} }
function DefaultGame::passRunningVote(%game, %admin, %arg1, %arg2, %arg3, %arg4)
{
if ( %admin && Game.scheduleVote !$= "" )
{
passCurrentVote();
messageAll('MsgAdminForce', '\c2The Admin passed the vote.' );
echo("The admin" SPC %admin.nameBase SPC "has passed the vote.");
}
}
function DefaultGame::stopRunningVote(%game, %admin, %arg1, %arg2, %arg3, %arg4)
{
%curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime();
if(%admin && Game.scheduleVote !$= "" && %curTimeLeftMS > 0)
{
stopCurrentVote();
messageAll('MsgAdminForce', '\c2The Admin stopped the vote.');
echo("The admin" SPC %admin.nameBase SPC "has stopped the vote.");
}
}
function adminStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4) function adminStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4)
{ {
if ( Game.scheduleVote !$= "" && Game.voteType $= %typeName ) if ( Game.scheduleVote !$= "" && Game.voteType $= %typeName )
@ -1414,7 +1518,8 @@ function checkMapExist(%missionName, %missionType)
// passCurrentVote() // passCurrentVote()
// Info: passes a vote that is running. // Info: passes a vote that is running.
function passCurrentVote() // Edit GG // Eolk - Removed *** classic admin stuff.
function passCurrentVote(%admin)
{ {
if(Game.scheduleVote !$= "") if(Game.scheduleVote !$= "")
{ {
@ -1444,15 +1549,20 @@ function passCurrentVote() // Edit GG
cancel(Game.voteReminder[%i]); cancel(Game.voteReminder[%i]);
Game.voteReminder[%i] = ""; Game.voteReminder[%i] = "";
} }
messageAll('MsgAdminForce', "\c2The Admin " @ getTaggedString(%admin.name) @ " has passed the vote.");
} }
else
messageClient(%admin, "MsgClient", "\c2There is no vote to pass...");
} }
// stopCurrentVote() // stopCurrentVote()
// Info: stop a vote that is still running // Info: stop a vote that is still running
function stopCurrentVote() function stopCurrentVote(%admin)
{ {
if(Game.scheduleVote !$= "") if(Game.scheduleVote !$= "")
{ {
messageAll('closeVoteHud', ""); messageAll('closeVoteHud', "");
cancel(Game.scheduleVote); cancel(Game.scheduleVote);
Game.scheduleVote = ""; Game.scheduleVote = "";
@ -1466,7 +1576,11 @@ function stopCurrentVote()
cancel(Game.voteReminder[%i]); cancel(Game.voteReminder[%i]);
Game.voteReminder[%i] = ""; Game.voteReminder[%i] = "";
} }
messageAll('MsgAdminForce', "\c2The Admin " @ getTaggedString(%admin.name) @ " has cancelled the vote.");
} }
else
messageClient(%admin, "MsgClient", "\c2There is no vote to stop...");
} }
// calcVotes(%typeName, %arg1, %arg2, %arg3, %arg4) // calcVotes(%typeName, %arg1, %arg2, %arg3, %arg4)
@ -1639,3 +1753,43 @@ function VoteSound(%teamSpecific, %typename, %arg1, %arg2, %msg)
} }
} }
} }
function DefaultGame::setNextMission(%game, %client, %map, %type, %mapIndex, %typeIndex)
{
if(%client.isAdmin || %client.isSuperAdmin)
{
$voteNext = 1;
$voteNextType = %typeIndex;
$voteNextMap = %mapIndex;
messageAll('MsgAdminChangeMission', '\c2The Admin %3 has set the next mission to %1 (%2).~wfx/misc/hunters_greed.wav', $HostMissionName[%mapIndex], $HostTypeDisplayName[%typeIndex], %client.name );
adminLog(%client, " has set the next mission to" SPC $HostMissionName[%mapIndex] @ "(" @ $HostTypeDisplayName[%typeIndex] @ ").");
}
else
{
%totalVotes = %game.totalVotesFor + %game.totalVotesAgainst;
// Added people who dont vote into the equation, now if you do not vote, it doesn't count as a no. - z0dd - ZOD
if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount - %game.totalVotesNone)) > ($Host::VotePasspercent / 100))
{
$voteNext = 1;
$voteNextType = %typeIndex;
$voteNextMap = %mapIndex;
messageAll('MsgVotePassed', '\c2Next mission set to %1 (%2) by vote.', $HostMissionName[%mapIndex], $HostTypeDisplayName[%typeIndex]);
//Log Vote % - Must be before Game Over
%key = "Passed";
votePercentLog(%missionDisplayName, %typeName, %key, %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, %game.totalVotesNone);
//Show Vote %
messageAll('', '\c1Vote %6: \c0Yea: %1 Nay: %2 Abstain: %7 Total: %3 [%4%5]', %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, mfloor((%game.totalVotesFor/(ClientGroup.getCount() - %game.totalVotesNone)) * 100), "%", %key, %game.totalVotesNone);
}
else
{
messageAll('MsgVoteFailed', '\c2Next mission vote did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount - %game.totalVotesNone) * 100));
//Log Vote %
%key = "Failed";
votePercentLog(%missionDisplayName, %typeName, %key, %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, %game.totalVotesNone);
//Show Vote %
messageAll('', '\c1Vote %6: \c0Yea: %1 Nay: %2 Abstain: %7 Total: %3 [%4%5]', %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, mfloor((%game.totalVotesFor/(ClientGroup.getCount() - %game.totalVotesNone)) * 100), "%", %key, %game.totalVotesNone);
}
}
}