• Simple Map Voting Addon
    235 replies, posted
I was wondering if anyone had perhaps been working on/added a cooldown yet for this addon? Ever since adding this to our server we've definitely been seeing patterns of people, say, going to Rooftops, then another map, then back to Rooftops. We could really use some form of a cooldown to allow more variety. Thanks in advance for any help, and thank you Willow for this wonderful mapvote addon! It works beautifully.
[QUOTE=Splittykitty;40780541]I was wondering if anyone had perhaps been working on/added a cooldown yet for this addon? Ever since adding this to our server we've definitely been seeing patterns of people, say, going to Rooftops, then another map, then back to Rooftops. We could really use some form of a cooldown to allow more variety. Thanks in advance for any help, and thank you Willow for this wonderful mapvote addon! It works beautifully.[/QUOTE] If the majority of the people want a map then the map should be selected. If the minority want a map then they should try and get more people to vote for the same map lol. Btw his name is Willox.
Is it possible for it to initiate this by something like !votemap or keypress instead of time based or round based similar to how Fretta use to change gamemodes?
[QUOTE=The-Spy;40783697]Is it possible for it to initiate this by something like !votemap or keypress instead of time based or round based similar to how Fretta use to change gamemodes?[/QUOTE] If you have ULX then just put this code into a *.lua file in ulx/lua/ulx/modules/sh/ [code]------------------------------ VoteMap ------------------------------ function AMB_mapvote( calling_ply, votetime, should_cancel ) if not should_cancel then MapVote.Start(votetime, false, 48, {"ttt_"}) ulx.fancyLogAdmin( calling_ply, "#A called a votemap!" ) else MapVote.Cancel() ulx.fancyLogAdmin( calling_ply, "#A canceled the votemap" ) end end local mapvotecmd = ulx.command( CATEGORY_NAME, "mapvote", AMB_mapvote, "!mapvote" ) mapvotecmd:addParam{ type=ULib.cmds.NumArg, min=15, default=25, hint="time", ULib.cmds.optional, ULib.cmds.round } mapvotecmd:addParam{ type=ULib.cmds.BoolArg, invisible=true } mapvotecmd:defaultAccess( ULib.ACCESS_ADMIN ) mapvotecmd:help( "Invokes the map vote logic" ) mapvotecmd:setOpposite( "unmapvote", {_, _, true}, "!unmapvote" )[/code]
That works alongside Willox's system too, right?
I'm having a problem with the double vote power. Trying to give it to some user groups however it does not seem to work. How i currently have made it: [lua] function MapVote.HasExtraVotePower(ply) -- Example that gives admins more voting power if ply:IsAdmin() then elseif ply:IsUserGroup("donator") then elseif ply:IsUserGroup("ddonator") then elseif ply:IsUserGroup("moderator") then return true end return false end [/lua] Edit: Never mind, Fixed it. xD
[QUOTE=The-Spy;40794619]That works alongside Willox's system too, right?[/QUOTE] The-Spy, Yes that was a repost of the code I posted on page 2 of this thread, it will work with Willox's system :) Let me know if you have any issues with it.
Got it to work after some work! Only problem is sometimes when the timer is done, the client gets kicked due to lua errors. Only happened once so far. [CODE] [ERROR] addons/mapvote/lua/mapvote/cl_mapvote.lua:317: Tried to use invalid object (type Panel) (Object was NULL or not of the right type) 1. __newindex - [C]:-1 2. unknown - addons/mapvote/lua/mapvote/cl_mapvote.lua:317 Timer Failed! [Simple][@addons/mapvote/lua/mapvote/cl_mapvote.lua (line 317)] [/CODE] Does this code allow players to use the !mapvote command similar to ulx !votemap or is it just admin? I was mostly looking for a replacement for the player !votemap without timers or end round votes.
The-Spy, I've not personally experienced this, this command is set so that Admins and above have access to the command, it's invoked like this: "!mapvote 30" this would cause the mapvote to display and last 30 seconds. Specifying the time is optional, and by default, it will issue a 25 second mapvote. Anyhow, that error you're getting above is not something I've personally experienced and looking into it, it's related to: [code] timer.Simple( 0.4, function() bar.bgColor = Color( 0, 255, 255 ) surface.PlaySound( "hl1/fvox/blip.wav" ) end ) [/code] Nothing in that segment of code I provided would cause that error, I'll have to defer that question to Willox. Sorry I couldn't be of further assistance with this.
Just something caused by the client being a tad behind the server. It just needs an IsValid check around "bar.bgColor = Color( 0, 255, 255 )" but I'm not at home so I can't fix it right now. If you're interested in fixing the line yourself: [lua]timer.Simple( 0.4, function() if IsValid(bar) then bar.bgColor = Color( 0, 255, 255 ) end surface.PlaySound( "hl1/fvox/blip.wav" ) end )[/lua]
Very nice work. Looks so much better than all the other TTT voting systems on the workshop and such.
Thank you very much. This looks beautiful, and works perfectly. Always wanted something like this on my server. Thank you again, good sir.
As other have suggested, it would be great to have a map cooldown period of a couple rounds. So two maps aren't frequently repeated.
anyone knows how to make a cool down for maps vote? I hate that players sometimes play the same maps over and over, having a cool down would make this perfect.
Idk if it has to do with Gmod update, but now my server randomly changes map... without vote or anything, it was working perfectly before. [B]EDIT:[/B] Fixed, I only needed to re-edit the init.lua file.
[QUOTE=faintblaster;40845937]As other have suggested, it would be great to have a map cooldown period of a couple rounds. So two maps aren't frequently repeated.[/QUOTE] [QUOTE=hellguy;40910597]anyone knows how to make a cool down for maps vote? I hate that players sometimes play the same maps over and over, having a cool down would make this perfect.[/QUOTE] Okay guys, here you go: [url]https://github.com/tyrantelf/gmod-mapvote/archive/master.zip[/url] I forked it and edited it with a cooldown for my servers. It's configurable in the autorun/mapvote.lua file how many maps you want to run before it shows up again. Default is 3. It also has a true/false to enable/disable it. I'm going to be modifying it some more, like integrating an rtv into it and making it work without editing the init.lua at some point, so keep an eye on the repo [url]https://github.com/tyrantelf/gmod-mapvote[/url] if your interested. On a side note, I did get permission from Willox to modify this and rerelease it as long as it still has his a link back to this thread and credits to him. EDIT: I decided to stay on and integrate the SMVrtv into it, if you don't want it just delete mapvote/rtv.lua and remove "include("mapvote/rtv.lua")" from autorun/mapvote.lua. I'm going to make some modifications to it at some point, but for now it's the same that was was previously uploaded. the MapPrefixes config option is just for RTV. You STILL have to edit init.lua for it to work! EDIT 2: My GMOD wasn't updated last night (My internet is crap) and I had someone else test it. They were blind and dumb, apperantly, as neither of my changes worked. I just fixed RTV, however you still have to change the prefixes on line 31 of mapvote/rtv.lua. I will be fixing the cooldown later today, hopefully.
I don't know if you saw my latest release for the rtv, but I put a ttt version out that called the mapvote from a hook. Most ttt players complain when a match is interrupted, so I called it on the TTTPrepareRound hook. There's a TTTDelayRoundStartForVote hook, but it doesn't seem to work properly. If you could work that in, I'm sure some people would be very happy.
I have a bug that i cant seem to fix, tried reinstalling and everything [code] [ERROR] gamemodes/terrortown/gamemode/init.lua:729: attempt to index global 'MapVote' (a nil value) 1. CheckForMapSwitch - gamemodes/terrortown/gamemode/init.lua:729 2. EndRound - gamemodes/terrortown/gamemode/init.lua:756 3. unknown - gamemodes/terrortown/gamemode/init.lua:297 Timer Failed! [winchecker][@gamemodes/terrortown/gamemode/init.lua (line 348)] [/code] [editline]7th June 2013[/editline] This was AFTER updating to steampipe.
I have the same problem as above: [code][ERROR] gamemodes/terrortown/gamemode/init.lua:728: attempt to index global 'MapVote' (a nil value) 1. CheckForMapSwitch - gamemodes/terrortown/gamemode/init.lua:728 2. EndRound - gamemodes/terrortown/gamemode/init.lua:755 3. unknown - gamemodes/terrortown/gamemode/init.lua:300 Timer Failed! [winchecker][@gamemodes/terrortown/gamemode/init.lua (line 347)] [/code] Willox seems to be working on a fix.
It's still working for me. The error suggests that none of the code is running so all I can do is suggest a re-install of the addon. Otherwise it may be something related to SteamPipe. [editline]7th June 2013[/editline] Alternatively: Check for errors that occur as the server starts. Stuff that relates to the mapvote addon specifically.
I have just tried it with a raw server and it seems to work. I used ULX as admin mod and I am going to install ULX again and see if that causes the error. Ill update this post upon new informations. Edit: It works with ULX and TTT.
Okay, got a fulling working version going with lots of nice things! Added: Built in RTV Built in ULX commands CoolDown System (If it's not changed using the mapvote system, the map won't be added to the cooldown list. Soo, if you want cooldown to work, then I'd suggest not manually changing maps.) recentmaps.txt auto-deletes at shutdown (This is where the recent maps played are stored for the cooldown) JSON config that autocreates in garrysmod/data/mapvote/config.txt Coming soon: Automatically working with TTT (and possibly other gamemodes) RTV vote only starts at the end of TTT rounds (Enable/Disable available) [B][U]Editing the config[/U][/B] This is the default config: [CODE]{"MapPrefixes":{"1":"ttt_"},"MapLimit":24,"TimeLimit":28,"AllowCurrentMap":false,"MapsBeforeRevote":3,"EnableCooldown":true}[/CODE] To change most settings, edit the number/true or false after the colon. "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: [CODE]{"MapPrefixes":{"1":"ttt_","2":"zm_","3":"de_"},"MapLimit":24,"TimeLimit":28,"AllowCurrentMap":false,"MapsBeforeRevote":3,"EnableCooldown":true}[/CODE] This is tested and working on my test server, and all but the config is in production on my servers at the moment. The config is going to be pushed to my servers in a bit. [U][B]You STILL have to edit the init.lua in this release[/B][/U] Getting my version: Go here: [url]https://github.com/tyrantelf/gmod-mapvote[/url] click the "Zip" button. Report issues here: [url]https://github.com/tyrantelf/gmod-mapvote/issues[/url]
[QUOTE=sab0tage3;40940195]I have just tried it with a raw server and it seems to work. I used ULX as admin mod and I am going to install ULX again and see if that causes the error. Ill update this post upon new informations. Edit: It works with ULX and TTT.[/QUOTE] So basically reinstall the server?
[QUOTE=LewisUK;40946419]So basically reinstall the server?[/QUOTE] Thats what I did to fix it. Maybe there is another way but I had to reinstall.
I've pushed a few fixes and things. I can't list them all. The just of it is that TTT and Deathrun should now work automatically. Deathrun uses it's built-in RTV system (so the MaxPlayers has to be set in it's config for it). The Auto-Generating config has been a bit finicky, if doesn't auto-fill the config.txt, just copy the example config into it. Without further ado: [url]https://github.com/tyrantelf/gmod-mapvote[/url] Choose the zip download. Report issues at [url]https://github.com/tyrantelf/gmod-mapvote/issues[/url] Features to come: Delay RTV vote to end of TTT round. Anything you guys suggest that I feel will work well.
[QUOTE=tyrantelf;40950159] Features to come: Delay RTV vote to end of TTT round. Anything you guys suggest that I feel will work well.[/QUOTE] Make it possible to add more than 24 maps.
[QUOTE=pkhzor;40950849]Make it possible to add more than 24 maps.[/QUOTE] In my version there's a config at garrysmod/data/mapvote/config.txt that should contain this: [CODE]{"RTVPlayerCount":3,"MapLimit":24,"TimeLimit":28,"AllowCurrentMap":false,"MapPrefixes":{"1":"ttt_"},"MapsBeforeRevote":3,"EnableCooldown":true}[/CODE] See the "MapLimit"? Change the number after it in the config.txt, then change the map/restart the server.
[QUOTE=tyrantelf;40950976]In my version there's a config at garrysmod/data/mapvote/config.txt that should contain this: [CODE]{"RTVPlayerCount":3,"MapLimit":24,"TimeLimit":28,"AllowCurrentMap":false,"MapPrefixes":{"1":"ttt_"},"MapsBeforeRevote":3,"EnableCooldown":true}[/CODE] See the "MapLimit"? Change the number after it in the config.txt, then change the map/restart the server.[/QUOTE] So it will display more than 24? Also, this just goes into addons or do I need to put the files in specific locations?
[QUOTE=pkhzor;40951360]So it will display more than 24? Also, this just goes into addons or do I need to put the files in specific locations?[/QUOTE] Download this: [url]https://github.com/tyrantelf/gmod-mapvote/archive/master.zip[/url] put the gmod-mapvote-master folder into your addons folder. start server, then go to garrysmod/data/mapvote/ and edit the config.txt to your liking. change the map/restart the server. Done. If you want a description of what the connfig options do, look here: [url]https://github.com/tyrantelf/gmod-mapvote#ttt-and-deathrun-setup[/url]
[QUOTE=LewisUK;40946419]So basically reinstall the server?[/QUOTE] Actually, found a fix xD i was running linux server so all addon folder names needed to be lower case, the addons that didnt run were not in lowercase.
Sorry, you need to Log In to post a reply to this thread.