Coder Social home page Coder Social logo

gmod-mapvote's Introduction

MapVote

MapVote is a wonderful little GMOD13 addon originally made by Willox that allows you to easily invoke a map vote from within any gamemode of your choosing.

It recieved many suggestions and additions in it's original facepunch thread.

This is my version which takes many of the additions and suggestions, and impliements them in one, simple, configurable addon.

You can also get this addon through steam workshop!

Usage

Starting a vote from within lua is rather simple.

MapVote.Start(voteLength, allowCurrentMap, mapLimit, mapPrefix)

All arguments to this function are optional and the map prefix is acquired from the config, or if it isn't set, gamemode.txt file if available. You can also set up defaults within garrysmod/data/mapvote/config.txt which is generated during the first run.

It is also possible to cancel map votes from within lua with:

MapVote.Cancel()

You can give players extra voting power in lua/autorun/mapvote.lua with the MapVote.HasExtraVotePower function, and a config will be added at some point.

TTT and Deathrun Setup

You no longer have to edit any files for MapVote to work with Trouble in Terrorist Town or Deathrun anymore! It now overrides the default functions for map switching.

Note: On Deathrun, it still uses the build in RTV, so changing the minimum player count doesn't work

You can edit the config.txt located in garrysmod/data/mapvote/ to change several settings. It should look like this by default (if it's empty, just copy this into it):

{"RTVPlayerCount":3,"MapLimit":24,"TimeLimit":28,"AllowCurrentMap":false,"MapPrefixes":{"1":"ttt_"},"MapsBeforeRevote":3,"EnableCooldown":true}
  • "RTVPlayerCount" is the minimum number of players that need to be online (on TTT) for RTV to work.
  • "MapLimit" is the number of maps shown on the vote screen.
  • "TimeLimit" is how long the vote is shown for.
  • "AllowCurrentMap" true/false to allow a the current map in the map vote list.
  • "MapPrefixes" are the prefixes of the maps that should be used in the vote.
  • "MapsBeforeRevote" is the number of maps that must be played before a map is in the vote menu again (if EnableCooldown is true)
  • "EnableCooldown" is a true/false variable on whether to remove a map from voting for a while after it's played.
  • "MapsBeforeRevote" is how many maps before the map is taken off the cooldown list after it's played.

To add more Map Prefixes, do this:

{"RTVPlayerCount":3,"MapLimit":24,"TimeLimit":28,"AllowCurrentMap":false,"MapPrefixes":{"1":"ttt_","2":"zm_","3":"de_"},"MapsBeforeRevote":3,"EnableCooldown":true}

Modifications

Featuress added made by others:

  • RTV Implimentation by Eccid
  • ULX integration by Ambro
  • RTV vote delay to end of TTT and Deathrun rounds (Thanks Again, Willox!)

My Feature Additions:

  • CoolDown System
  • JSON config that auto-generates at garrysmod/data/mapvote/config.txt
  • Automatically working with TTT and Deathun

Planned Feature Additions:

  • Enable/Disable on RTV delay to round end on TTT and Deathrun
  • Config to give extra voting power

gmod-mapvote's People

Contributors

chessnut avatar cschulz avatar sunred avatar willox avatar

Watchers

 avatar  avatar  avatar

Forkers

100acrebb

gmod-mapvote's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.