Skip to content

needkg/cs2-modemanager

Repository files navigation

nModeManager

nModeManager is a CS2 plugin for CounterStrikeSharp focused on practical mode rotation:

  • player voting with !rtv
  • map selection per mode
  • safe mode switching with delay and cooldown
  • admin mode/map override command

Player Experience

  • !rtv opens a guided flow: mode -> map -> confirm vote.
  • If a vote is already active, players can only vote for that same mode.
  • During an active vote, players can still choose a different map inside that mode.
  • If a player already voted and runs !rtv again, they receive live vote status in chat.
  • If a vote expires without enough votes, the plugin announces final vote progress and closes the vote.

Admin Experience

  • Force mode switch quickly with: !mode <mode_key> [map]
  • Reload plugin config and dynamic commands without restarting server: !nmm_reload
  • Dynamic vote commands are auto-created from configured mode keys: if mode key is retake, command !retake is available.

Requirements

Quick Installation

  1. Install MenuManagerAPI and confirm the menu:api capability is available.
  2. Copy nModeManager.dll, nModeManager.deps.json, and Gameloop.Vdf.dll to: addons/counterstrikesharp/plugins/nModeManager/
  3. Copy the lang folder to: addons/counterstrikesharp/plugins/nModeManager/lang/
  4. Create or edit: addons/counterstrikesharp/configs/plugins/nModeManager/nModeManager.json
  5. Restart the server (or reload plugins).

Minimal Config (Copy/Paste)

{
  "language": "en",
  "initial_mode_key": "retake",
  "apply_initial_mode_on_startup": true,
  "reset_command": "exec nmodemanager/reset.cfg",
  "vote_ratio": 0.6,
  "vote_min_players": 1,
  "vote_duration_seconds": 120,
  "switch_cooldown_seconds": 20,
  "switch_delay_seconds": 5,
  "apply_game_type_mode": true,
  "debug": false,
  "endmatch_map_vote_enabled": true,
  "modes": {
    "retake": {
      "key": "retake",
      "display_name": "Retake",
      "exec_command": "exec nmodemanager/retake.cfg",
      "default_map": "de_inferno",
      "map_pool": [
        "de_inferno",
        "de_nuke",
        "de_mirage"
      ],
      "game_type": 0,
      "game_mode": 0,
      "plugins_to_unload": [],
      "plugins_to_load": []
    }
  }
}

For end-match map vote, gamemodes_server.txt and mapgroup prefix mg_nmm_ are hardcoded.

Commands

Player Commands

Command Description
!nmm Show help
!modes List available modes
!rtv Open RTV vote menu
!<mode_key> Vote directly for a mode (example: !retake)

Admin (@css/root) and Console Commands

Command Description
!mode <mode_key> [map] Force a mode switch with optional map
!rtv <enable|disable> Enable or disable RTV voting globally
!nmm_reload Reload config and rebuild dynamic mode commands

Voting Rules

  1. Player opens vote with !rtv.
  2. Player selects mode.
  3. Player selects map.
  4. Player confirms vote.
  5. Plugin broadcasts vote progress.
  6. If quorum is reached, mode switch is scheduled.
  7. If timer expires before quorum, vote closes and final status is announced.

Important:

  • one vote per player identity
  • bots and HLTV are excluded from eligible player count
  • required votes are calculated as: ceil(eligible_players * vote_ratio)
  • while a vote is active, mode choice is locked to the active vote mode
  • map target can still be adjusted within that active vote mode

Admin !mode Behavior

Examples:

  • !mode retake
  • !mode retake de_nuke

Rules:

  1. If map is invalid for the selected mode, plugin returns available maps for that mode.
  2. If selected mode is already active and no map is provided, command is blocked.
  3. If selected mode is already active and map equals current map, command is blocked.
  4. If selected mode is already active and map is valid and different, command is allowed.

Localization

Supported languages:

  • en
  • pt-BR
  • es

Set language in config: "language": "en"

Practical Tips

  • Keep map_pool populated for each mode to improve vote UX.
  • Use switch_delay_seconds to give players warning before switch.
  • Use switch_cooldown_seconds to prevent switch spam.
  • Run !nmm_reload after each config change.

Troubleshooting

!rtv does not open menu

Check if MenuManagerAPI is installed, loaded, and exposing menu:api.

!mode or !nmm_reload denied

Player must have @css/root permission.

Dynamic mode command is missing

Check mode key under modes and run !nmm_reload.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages