function DefaultGame::voteChangeMission(%game, %admin, %missionDisplayName, %typeDisplayName, %missionId, %missionTypeId) { %mission = $HostMissionFile[%missionId]; if ( %mission $= "" ) { error( "Invalid mission index passed to DefaultGame::voteChangeMission!" ); return; } %missionType = $HostTypeName[%missionTypeId]; if ( %missionType $= "" ) { error( "Invalid mission type id passed to DefaultGame::voteChangeMission!" ); return; } if(%admin) { messageAll('MsgAdminChangeMission', '\c2The Admin has changed the mission to %1 (%2).', %missionDisplayName, %typeDisplayName ); logEcho("mission changed to "@%missionDisplayName@"/"@%typeDisplayName@" (admin)"); %game.gameOver(); loadMission( %mission, %missionType, false ); } else { %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100)) { messageAll('MsgVotePassed', '\c2The mission was changed to %1 (%2) by vote.', %missionDisplayName, %typeDisplayName ); logEcho("mission changed to "@%missionDisplayName@"/"@%typeDisplayName@" (vote)"); %game.gameOver(); loadMission( %mission, %missionType, false ); } else messageAll('MsgVoteFailed', '\c2Change mission vote did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); } }
function DefaultGame::voteChangeMission(%game, %admin, %missionDisplayName, %typeDisplayName, %missionId, %missionTypeId) { %mission = $HostMissionFile[%missionId]; if ( %mission $= "" ) { error( "Invalid mission index passed to DefaultGame::voteChangeMission!" ); return; } %missionType = $HostTypeName[%missionTypeId]; if ( %missionType $= "" ) { error( "Invalid mission type id passed to DefaultGame::voteChangeMission!" ); return; } //Begin edit else if (%missionType !$= "CTF") { messageAll('MsgVoteFailed', '\c2Change mission vote did not pass becuase this server is restricted to CTF maps.'); return; } //End edit if(%admin) { messageAll('MsgAdminChangeMission', '\c2The Admin has changed the mission to %1 (%2).', %missionDisplayName, %typeDisplayName ); logEcho("mission changed to "@%missionDisplayName@"/"@%typeDisplayName@" (admin)"); %game.gameOver(); loadMission( %mission, %missionType, false ); } else { %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100)) { messageAll('MsgVotePassed', '\c2The mission was changed to %1 (%2) by vote.', %missionDisplayName, %typeDisplayName ); logEcho("mission changed to "@%missionDisplayName@"/"@%typeDisplayName@" (vote)"); %game.gameOver(); loadMission( %mission, %missionType, false ); } else messageAll('MsgVoteFailed', '\c2Change mission vote did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); } }
Comments
Change to:
Didnt compile so if it doesnt work, thats y. Also note "CTF" might need to be something else, but... im lazy.