Hi Guys,
Each time that we use "!setnextmap mapname" the current "map rotation" gets reset.
After playing "mapname" the rotation starts at the beginning instead of continue where it was.
One could argu if this is wanted or not, aka a bug or not.
I Found a fix for resetting the map rotation, I hope you like it:
- Open the file called:mod.class.php
- find this code:
//=============================================================
public function rconSetNextMap($map, $gametype) {
$nextmap = "gametype " . $gametype . " map " . $map;
$this->rconSetDvar("sv_maprotationcurrent", $nextmap);
return true;
}
//=============================================================
- replace it with this code:
//=============================================================
// sv_mapRotation is the list of maps and gametypes to play in the rotation.
// The game does not touch it in anyway accept to read it once during a rotation.
// sv_mapRotationCurrent is created by the game. It uses it internally to keep track of the current rotation.
// Each time a map_rotation is called for, it looks at that string.
// It strips the first map and map name from the head of that string and that is the map that it starts.
// Notice that the sv_mapRotationCurrent string has been modified by the game. The string is now shorter.
// When that string is finally empty after running thru the whole rotation,
// the game then copies the contents of sv_mapRotation to sv_mapRotationCurrent (including the gametype specifiers) and the process starts again.
public function rconGetCurrentMapRotation() {
$return = $this->rconDvarList("sv_maprotation*");
$current = $return["sv_maprotationcurrent"];
return $current;
}
// Insert the "nextmap" before the current rotation sequence.
// The rotation will continue as where it was after playing the "special inserted map"
public function rconSetNextMap($map, $gametype) {
$nextmap = "gametype " . $gametype . " map " . $map . " " . $this->rconGetCurrentMapRotation();
$this->rconSetDvar("sv_maprotationcurrent", $nextmap);
return true;
}
//=============================================================
Restart the adminmod and your fixed.
Each time that you Use "setnextmap" the map is inserted before the rest of the rotation.
Therefor the rotation does not get reset each time that you use this command.
I hope you like this fix/addon.
Kind regards,
DFC-NightMare[NL]