Garry's Mod

Garry's Mod

Not enough ratings
Raf's MapVote
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Server content
Addon Tags: Fun, Roleplay, Realism
File Size
Posted
Updated
78.874 KB
28 Nov, 2022 @ 10:24am
10 Jan, 2023 @ 7:36am
6 Change Notes ( view )

Subscribe to download
Raf's MapVote

In 1 collection by Raf
TTT server essentials
4 items
Description
What is it?
Raf's MapVote is a server addon for Garry's Mod that allows players to vote for the next map to be played. This addon is specifically tailored for the Trouble in Terrorist Town (TTT) gamemode, but includes admin commands to be manually started with any gamemode.

Features
  • Keeps track of how many times each map has been played.
  • Ability to choose specific maps to be in the mapvote rotation or use all the maps located on the server, with the ability to filter them by prefix (e.g. ttt_, cs_").
  • A static number of candidate maps (6). Candidates maps consist of 3 "popular" maps and 3 random maps. "Popular" maps have the highest play count on the current server. There's also a "random" button for the indecisive and an "extend" button to vote for extending the current map.
  • Cooldown system. After a map has been played, it won't show up as a candidate for a number of maps (configurable).
  • Ability to use map thumbnails from other addons (e.g. ttt_map_icons) or insert a custom image for each map (this option would require to force the clients to download the image as well).
  • Rock the vote implementation, to skip a map, if the majority (configurable) votes to do so.
  • A map pool screen, that any player can open by typing "!rmvpool". This shows the maps currently included in the map pool, as well as tagging maps on cooldown.
  • Darkmode/lightmode color schemes that are saved as a convar "rmv_lightmode 1/0".
  • Admin console command "rmv_start" to manually start the mapvote.
  • ULX integration - ability for admins to manually start the mapvote with the "ulx rmvstart" command or through the graphical menu.

Config
The config file is automatically generated after running the server once with the addon installed in "garrysmod/data/rafsmapvote/config_rafs_mapvote.json".

  • MAPS : ["cs_office", "ttt_67thway_v3"] - Custom map pool. If left empty, will use every map on the server, taking into account the given map prefixes. If setting a custom map pool, you should always have at least 6 + MAP_COOLDOWN amount of maps in the map pool, to avoid potential issues.
  • MAP_PREFIX : ["ttt_", "cs_"] - Filters the map pool with the given prefixes.
  • MAP_COOLDOWN : 5 - Map changes before a recently played map can be a mapvote candidate.
  • TIMER : 45 - Vote time in seconds.
  • NO_VOTE_TO_RANDOM : false - If a player doesn't vote, does it vote go to a random candidate.
  • RTV_MIN : 3 - Minimal player count on the server, for RTV to be enabled.
  • RTV_TIME : 300 - Time in seconds after which RTV is enabled.
  • RTV_PERCENT: 0.6 - Percentage of players needed to RTV.
  • DATA_DIR : "rafsmapvote/" - Data directory. You shouldn't change this.
  • THUMBNAIL_DIR : "rafsmapvote/thumbnails" - Directory to place your custom thumbnails, they should have the filename ttt_mapname.jpg/.png. If placing images here, you are responsible for sending them to the client.
  • FORCE_VOTE_USER_GROUPS: ["superadmin"], ["admin"] - Roles that can force the mapvote by using the "rmv_start" console command. If using ULX, you should prefer to use the appropriate ULX command and setup permissions there.

Thumbnail icons are prioritized as follows:
  1. Custom .png or .jpg files under THUMBNAIL_DIR (e.g. data/rafsmapvote/thumbnails/ttt_MAPNAME.jpg)
  2. Map thumbnails in maps/thumb/ (this also usually includes addons like ttt_map_icons)
  3. Defaults to "no map preview" image

Chat commands
  • !rmvlist, !mappool, !rmvpool - Opens a map list window where the player can view the current server map pool.
  • !rtv - Vote to rock the vote.
  • !rmv [duration] [noVotesToRandomVotes] - Force starts the mapvote through ULX (ULX custom permissions apply).

Console commands
  • rmv_lightmode 0/1 - Toggles the "light mode" color scheme.
  • rmv_start - Force starts the mapVote, if player is under a FORCE_VOTE_USER_GROUPS (config) player group.
  • ulx rmvstart [duration] [noVotesToRandomVotes] - Force starts the mapvote through ULX (ULX custom permissions apply).
Popular Discussions View All (1)
3
5 Apr, 2023 @ 5:28am
Bug
[★SG★] Guushi
11 Comments
craxxybraxxy 28 Jun @ 7:17am 
GAY
4GClaroARG 18 Oct, 2024 @ 6:20am 
It's very good, I can make a recommendation. Being able to edit the name of the map would be a very good addition. Because some have names like ttt_fixdebug2home2.bsp and it would be nice to be able to edit it so that it appears as TTT Home v2.
[★SG★] Guushi 4 Apr, 2023 @ 10:05am 
I did create it. Hopefully you can figure out what it is soon because the map vote performs great overall otherwise
Raf  [author] 2 Apr, 2023 @ 9:35am 
Please create a new discussion and paste the server logs. I will look into this bug when I get the time
[★SG★] Guushi 2 Apr, 2023 @ 8:46am 
So like I'm trying to add 2 more maps and the mapvote is getting stuck when it goes to "generate mapvote candidates". If I remove those 2 maps it's fine. I've tried wiping the data folder completely and it just doesn't want to work for some reason. It causes the server to lock up and restart once it's running that.
Raf  [author] 13 Feb, 2023 @ 12:29am 
You can try this map icon pack see if it works and make something similar. It really isn't hard, just the matter of placing your premade thumbnails in a specific folder structure and uploading to the workshop.
Raf  [author] 13 Feb, 2023 @ 12:25am 
Did you handle sending the images from the server to the client (for example adding to fastDL). Honestly, the best way to add thumbnails is to create a workshop addon (or use an existing one) that contains all of your map images under maps/thumb/ and add it to your server's workshop collection. This would probably be the fastest, most reliable way.
[★SG★] Guushi 12 Feb, 2023 @ 4:59pm 
I did put both of them in there and they are jpg.
Raf  [author] 12 Feb, 2023 @ 12:47pm 
Hi, it should be /data/rafsmapvote/thumbnails/
If that doesn't work you can try maps/thumb/
Make sure your images are .png or .jpg e.g. /data/rafsmapvote/thumbnails/ttt_67thway_v3.jpg
[★SG★] Guushi 11 Feb, 2023 @ 1:42pm 
Where exactly do thumbnail images go? I put them in the data folder and they still aren't showing up. Is there a specific filepath they need on the webserver?