tyrantelf/gmod-mapvote

Map does not change

Closed this issue · 2 comments

MapVote initiates and works as intended until the timer counts down to 0, at which point it stays at 0 and does not change the map. The console outputs the following error:

[MapVote] lua/mapvote/sv_mapvote.lua:45: bad argument #1 to 'getn' (table expected, got nil)
  1. getn - [C]:-1
   2. CoolDownDoStuff - lua/mapvote/sv_mapvote.lua:45
    3. unknown - lua/mapvote/sv_mapvote.lua:148

Timer Failed! [RAM_MapVote][@lua/mapvote/sv_mapvote.lua (line 127)]

My data/mapvote/config.txt looks like this:
{"RTVPlayerCount":3,"MapLimit":24,"TimeLimit":28,"AllowCurrentMap":false,"MapPrefixes":{"1":"ttt_"},"MapsBeforeRevote":3,"EnableCooldown":true}

These are the addons I have on my server:
https://steamcommunity.com/sharedfiles/filedetails/?id=575841362

HOW TO FIX:
Change your data/mapvote/config.txt to look something like this:
{"RTVPlayerCount":3,"MapLimit":24,"TimeLimit":28,"AllowCurrentMap":false,"MapPrefixes":["ttt_"],"MapsBeforeRevote":3,"EnableCooldown":true}

Note the square brackets for map prefixes.

Please change github tutorial to reflect this.

my config looks exactly like this, but i still get the same error