Skip to content

M-archand/RockTheVote-CSS

 
 

Repository files navigation

CS2 RockTheVote (RTV)

GitHub Downloads

General purpose map voting plugin.

Features

  • Reads from a custom maplist

  • RTV Command (Using !rtv in chat, or with Panorama system that is built into CS2 [F1 = Yes, F2 = No])

  • End of Map Vote. Supports map cooldown, map extension option.

  • Map cooldown persistence. Recently played maps stay on cooldown across server restarts (stored in mapcooldown.txt).

  • !revote command. During an active End of Map Vote, lets a player reopen the menu to change their vote. Uses a frozen WASD menu with no exit, so they must make a selection. Re-typing !revote while the menu is open does nothing (vote already active). Toggled via EndOfMapVote.EnableRevote.

  • Nominate command (nominate a map to appear in the map vote). Partial name matching, and conflicting map name resolution (surf_beginner, surf_beginner2). Limit 1 per player.

    nominate

  • Supports workshop maps, and custom map names. E.g. "surf_beginner (T1, Staged)"

  • Nextmap command. Prints the next map to chat.

  • Translated (Google Translate, ymmv)

  • Extend command. !extend 10 extends map by 10 minutes (flag restricted)

  • Vote Extend command. !ve/!votextend starts a vote to extend the current map (flag restricted)

  • Map Chooser command. !mapmenu opens a menu with your map list, selected map is changed to immediately (flag restricted)

  • Optional sound alert when map vote or !rtv starts (configurable sound)

  • Optional hud alert

    hudalert

  • Optional chat/hud vote countdown

hudcountdown chatcountdown

  • Panorama Vote (F1 = Yes, F2 = No) for !rtv & !voteextend (optional)

panoramavote voteextend

  • ChatMenu/CenterHtmlMenu/WasdMenu/ConsoleMenu for EndOfMapVote/!nominate/!votemap (ScreenMenu temporarily removed)

wasdmenu chatmenu hudmenu

  • Maplist Validator. Send to error log or Discord when a map is no longer available on the workshop. Automatically removes invalid workshop maps from the in-memory map list so they can't be nominated, voted for, or switched to (maplist.txt is left untouched). Optionally set a Steam Web API key to batch validation (100 IDs per request) instead of 1 request/second HTML checks.

    MapDiscordWebhook WorkshopMapLog

  • !maps command. List all maps available in the console.

mapscommand

  • !reloadmaps command. Rebuild the map list mid game
  • !reloadrtv command. Reload the rtv config mid game

Requirements

CounterStrikeSharp (Tested on v369)

CS2MenuManager (Tested on v42)

Installation

[ Configuration ]

  • A config file will be created in addons/counterstrikesharp/configs/plugins/RockTheVote the first time you load the plugin.
  • Changes in the config file will require you to reload the plugin, restart the server, or using !reloadrtv (changing the map won't work).
  • Maps that will be used in RTV/nominate/votemap/end of map vote are located in addons/counterstrikesharp/plugins/RockTheVote/maplist.txt This canbe updated mid-game using the command !reloadmaps
{
  "ConfigVersion": 23,
  "Rtv": {
    "Enabled": true,
    "EnabledInWarmup": false,
    "EnablePanorama": true, # true = use built in Panorama voting system (F1 = Yes, F2 = No). False = use !rtv in chat
    "MinPlayers": 0,
    "MinRounds": 0,
    "ChangeAtRoundEnd": false, # false = use MapChangeDelay value below. true = wait until round end to change the map
    "MapChangeDelay": 5, # The delay in seconds after the rtv map vote has passed before the map is changed. 0 = immediate
    "SoundEnabled": false, # true = play a sound when the end of map vote starts.
    "SoundVolume": 1.0, # Volume of the alert sound. For any value other than 1.0 you must use a soundevent_hash in SoundPath
    "SoundPath": "sounds/vo/announcer/cs2_classic/felix_broken_fang_pick_1_map_tk01.vsnd_c",
    "MapsToShow": 6, # How many maps to show in the resulting map vote if the rtv passes
    "AlwaysActive": true, # true = rtv vote is always running once triggered by an initional rtv. false = timed duration (RtvVoteDuration)
	  "AlwaysActiveReminder": true, # true = print a reminder to chat at a given interval that an rtv vote is active, and how many more votes are required to pass
	  "ReminderInterval": 120, # how often the reminder is printed to chat in seconds
    "RtvVoteDuration": 60, # How long the rtv vote lasts
    "MapVoteDuration": 60, # How long the resulting map vote will last
    "CooldownDuration": 180, # How many seconds must pass before another !rtv can be initiated
    "MapStartDelay": 180, # How many seconds must pass after the map starts before an !rtv can be called
    "VotePercentage": 51, # Percentage of votes required to pass the vote
    "EnableCountdown": true, # Whether the chat/hud countdown is enabled
    "CountdownType": "chat", # chat = prints to chat on an interval how much time is left in the vote. hud = persistent alert on the hud counting down as each second passes
    "ChatCountdownInterval": 15 # If CountdownType = chat, how often we print to chat how much time is remaining to vote
  },
  "EndOfMapVote": {
    "Enabled": true,
    "EnableRevote": false, # true = players can type !revote to reopen the vote and change their choice (forced WASD menu, player frozen, no exit until they pick)
    "MapsToShow": 6, # How many maps to show in the vote. If IncludeExtendCurrentMap = true, the extension option takes up 1 slot
    "MenuType": "WasdMenu", # The menu that will be used to show the vote. Options = ChatMenu, CenterHtmlMenu, WasdMenu, ConsoleMenu
    "ChangeMapImmediately": false, # false = change when the map ends. true = change as soon as the VoteDuration ends
    "VoteDuration": 150, # How long the map vote will last (this must be smaller than TriggerSecondsBeforeEnd)
    "SoundEnabled": false, # true = play a sound when the end of map vote starts.
    "SoundVolume": 0.5, # Volume of the alert sound. For any value other than 1.0 you must use a soundevent_hash in SoundPath
    "SoundPath": "1974266470", # Filepath or soundevent_hash of the sound you want to be played
    "TriggerSecondsBeforeEnd": 180, # When the End of Map Vote will be triggered (this must be higher than VoteDuration)
    "TriggerRoundsBeforeEnd": 0, # What round the vote is trigger on (use 0 for game modes like surf/bhop/etc or it'll never appear)
    "DelayToChangeInTheEnd": 0, # How long the mvp screen shows at the end if ChangeMapImmediately = false
    "IncludeExtendCurrentMap": true, # Include an option to extend the current map
    "EnableCountdown": false, # Whether the chat/hud countdown is enabled
    "CountdownType": "chat", # chat = prints to chat on an interval how much time is left in the vote. hud = persistent alert on the hud counting down as each second passes
    "ChatCountdownInterval": 30, # If CountdownType = chat, how often we print to chat how much time is remaining to vote
    "ChatMapChoiceReminder": true, # Only applies when MenuType = ChatMenu. Periodically reprints the map choices and current vote tally to chat
    "ChatMapChoiceInterval": 30, # How often (seconds) the ChatMenu map choices are reprinted
    "EnableHint": true, # Shows a message in the center of the screen notifying that the map vote has started
    "HintType": "csay" # csay = hud message in lower middle. GameHint = game instructor text in center middle
  },
  "Nominate": {
    "Enabled": true,
    "EnabledInWarmup": true,
    "MenuType": "WasdMenu", # The menu that will be used to show the vote. Options = ChatMenu, CenterHtmlMenu, WasdMenu, ConsoleMenu
    "NominateLimit": 1, # How many maps a single player can nominate per map vote
    "Permission": "" # empty = anyone can use. "@css/vip" or "@css/admin,@css/mod" = any listed permission can use it
  },
  "Votemap": {
    "Enabled": false,
    "MenuType": "WasdMenu", # The menu that will be used to show the vote. Options = ChatMenu, CenterHtmlMenu, WasdMenu, ConsoleMenu
    "VotePercentage": 50, # Percentage of votes required to pass the vote
    "ChangeMapImmediately": true,
    "EnabledInWarmup": false,
    "MinPlayers": 0,
    "MinRounds": 0,
    "Permission": "@css/vip" # empty = anyone can use. "@css/vip" or "@css/admin,@css/mod" = any listed permission can use it
  },
  "VoteExtend": {
    "Enabled": false,
    "EnablePanorama": true, # true = use built in Panorama voting system (F1 = Yes, F2 = No). False = use !ve in chat
    "VoteDuration": 60, # How long the vote will last
    "VotePercentage": 50, # Percentage of votes required to pass the vote
    "CooldownDuration": 180, # How many seconds must pass before another !ve can be called
    "EnableCountdown": true,
    "CountdownType": "chat", # chat = prints to chat on an interval how much time is left in the vote. hud = persistent alert on the hud counting down as each second passes
    "ChatCountdownInterval": 15, # If CountdownType = chat, how often we print to chat how much time is remaining to vote
    "Permission": "@css/vip" # empty = anyone can use. "@css/vip" or "@css/admin,@css/mod" = any listed permission can use it
  },
  "MapChooser": {
    "Command": "mapmenu,mm", The command used to open the menu, multiple can be set
    "MenuType": "WasdMenu", # The menu that will be used to show the vote. Options = ChatMenu, CenterHtmlMenu, WasdMenu, ConsoleMenu
    "Permission": "@css/root,@css/changemap" # empty = anyone can use. any listed permission can use it
  },
  "General": {
    "AdminPermission": "@css/root,@css/admin", # Any listed permission can use !reloadrtv or !reloadmaps
    "DebugLogging": false, # true = verbose debug logging to the CSS log (vote flow, map change, hint and validation details)
    "MaxMapExtensions": 2,
    "RoundTimeExtension": 15, # How long the extension will be in minutes for !VoteExtend or End of Map Vote extension
    "MapsInCoolDown": 3, # How many recent maps that won't appear again in the End of Map Vote/can't be nominated (0 = no cooldown, but current map is always in cooldown)
    "HideHudAfterVote": true, # Only applicable in MenuType = HudMenu. true = closes the hud after the player has voted
    "RandomStartMap": false, # true = a random map will be used when the server restarts. false = will use whatever you set in your startup command
    "IncludeSpectator": true, # true = spectators can vote (only applicable to !rtv). false = spectators can't vote
  	"IncludeAFK": false, # true = AFK players are included in the vote count (only applicable to !rtv). false = AFK players aren't included in the vote count
  	"AFKCheckInterval": 60, # how often an AFK check occurs in seconds (compares players coordinates between current and last check, also run again when the vote is initiated)
    "EnableMapValidation": true, # true = the plugin will check if there are any workshop maps in your maplist.txt that are no longer on the workshop
    "SteamApiKey": "", # blank = use 1 request/second HTML checks. Set to a Steam Web API key to batch validation requests (100 IDs per call) Get one here: https://steamcommunity.com/dev/apikey
    "DiscordWebhook": "" # blank = no alert. Discord Webhook will alert you to any workshop maps in your maplist.txt that are no longer on the workshop. Enter the enite "https://discord.com/api/webhooks/xxx" url
  }
}

Adding workshop maps

surf_beginner:3070321829
surf_nyx (T1, Linear):3129698096
de_dust2

Roadmap

  • !extend max extension value
  • Add vote percentage required for winning map (e.g. must receive 25% of the vote)
  • Add vote runnoff (e.g. 2nd stage of voting between 2 maps if minimum vote percentage not achieved for a map)

Translations

Language
English
French
Spanish
Ukrainian
Turkish
Latvian
Hungarian
Polish
Russian
Portuguese (BR)
Chinese (Simplified)

About

A CS2 map voting plugin (RTV) using CounterStrikeSharp

Topics

Resources

Stars

19 stars

Watchers

1 watching

Forks

Contributors

Languages

  • C# 100.0%