There sould be similar commented code clientside to make donator icons twice as large too.
[editline]12th May 2013[/editline]
Actually, in 20 minutes I'll release an update to make it easy to give more donator power.
[editline]12th May 2013[/editline]
^done. There is a function in lua/autorun/mapvote.lua called MapVote.HasExtraVotePower that you can modify for this, it defaults to admins having more power.
I have a few possibly dumb questions.
Since map max map limit is 24, what happens if I have more maps? Will it pick them at random is is it always the same? If it's the same then is there an easy way to add more maps to the selection? I'm too scared to mess with the init.lua due to the server running, nobody likes lua error spam.
I hope I'd just have to change the number 24 in [code]
MapVote.Start(15, false, 24, "ttt_")[/code] but that's wishful thinking.
what happens is that any extra typically end up showing if you scroll as for getting more than just ttt maps you do have to add their prefix to the init or it typically wont list them
As listed above something like this *replace prefixes for ones that you use for your server*
MapVote.Start(15, false, 24, {"ttt_", "dm_", "cs_", "de_"})
as for the number of rows I haven't gotten more to show up by editing 24 to a different number but then again I cant say whether editing 24 caused the scroll option. I'd edit and find out for ya but the risk is the true fun of gmods lua .
Live editing may cause errors but they usually resolve after map change. It's advisable to edit when the server is empty if you really don't want to risk it.
I recently modified my RTV script to allow for waiting til the end of the round to vote for TTT servers, instead of interrupting matches. Would you guys be interested in it?
Eccid, I was actually thinking about integrating this votemap into RTV, if you've already accomplished this feat, I'd love to take a look!
[QUOTE=Ambro;40628440]Eccid, I was actually thinking about integrating this votemap into RTV, if you've already accomplished this feat, I'd love to take a look![/QUOTE]
Yeah, I put a dl link [url=http://facepunch.com/showthread.php?t=1268353&p=40564564&viewfull=1#post40564564]here[/url].
I updated it [url=http://facepunch.com/showthread.php?t=1268353&p=40568962&viewfull=1#post40568962]here[/url].
And for anyone who's interested [url=http://pastebin.com/qcgjRHAF]here's[/url] the TTT version. Just replace your /garrysmod/addons/SMVrtv/lua/rtv/rtv.lua with the one in the link.
[editline]13th May 2013[/editline]
[QUOTE=Sgt. Sicknezz;40584559]DeathRun, not JB :P
Any one know how to set this up for DeathRun, iv been looking in the scripts and I can't really find the map vote... I think I'm going blind.
[/QUOTE]
Ok, I'm looking at mr gashes deathrun, so I'm hoping that's the one you're using. To make the RTV call this mapvote open the file deathrun\gamemode\rtv\sv_rtv.lua and go to line 48:
[CODE]function RTV.Start()
SetGlobalBool( "In_Voting", true )
for k, v in pairs( player.GetAll() ) do
net.Start( "RTVMaps" )
net.WriteTable( RTV.Maps )
net.Send( v )
umsg.Start( "RTVoting", v )
umsg.End()
end
timer.Simple( 30, function()
RTV.Finish()
end )
end[/CODE]
and replace it with just this:
[CODE]function RTV.Start()
MapVote.Start(voteLength, allowCurrentMap, mapLimit, {"dr_", "deathrun_"})
end[/CODE]
(Rememer, you can set the votelength, allowing of current map, and map limit at the top of the file garrysmod/addons/MapVote/lua/autorun/mapvote.lua. Then you only need to change the MapVote.Start for special cases.)
I don't see anything about round end map voting, and I don't play deathrun so I'm not sure if this does have it. It seems like it's just limited to map changes via the RTV script. Try this out, run some tests, and tell me if it works.
Would it be possible for you to add a map cooldown system to this?
As while it is a great map vote system, the constant map1..map2...map1...map2 over and over again starts to get really boring when the players keep on voting the same 2 maps over and over again.
So if possible add an option where we can set that once a map has been played another x number of maps have to be played before it shows up in the vote again.
Remove....
I didn't notice Eccid did the same thing before,
[url]http://pastebin.com/VPXRL9yv[/url]
How would i achieve making it so the power that people get extra is higher than 2? (eg.4)
[QUOTE=LewisUK;40687029]How would i achieve making it so the power that people get extra is higher than 2? (eg.4)[/QUOTE]
You'll have to add this yourself, look for all calls to the MapVote.HasExtraVotePower() function and modify how the script interacts with the returned variable.
[QUOTE=Willox;40687154]You'll have to add this yourself, look for all calls to the MapVote.HasExtraVotePower() function and modify how the script interacts with the returned variable.[/QUOTE]
Thanks, btw awesome votemap!
[lua] local ValidMaps = {}
local Types = "" --If there's no maps, choose all maps
for _,v in pairs( engine.GetGamemodes() ) do --Probably a better way to do this
if v.title==( (GAMEMODE and GAMEMODE.Name) or (GM and GM.Name) ) then --It's the current gamemode
Types = v.maps or "" --This is our prefix list
break
end
end
Types = string.Explode( "|", string.gsub( Types, "%^", "" ) ) --Split it to a table
for _,v in pairs(Types) do
local maps = file.Find( "maps/"..v.."*.bsp", "GAME" ) --Find maps with this prefix
table.Add( ValidMaps, maps ) --Combine it with our list
end[/lua]
Explicitly stating the prefixes seems unnecessary when the gamemode already does
[QUOTE=my_hat_stinks;40687406][lua] local ValidMaps = {}
local Types = "" --If there's no maps, choose all maps
for _,v in pairs( engine.GetGamemodes() ) do --Probably a better way to do this
if v.title==( (GAMEMODE and GAMEMODE.Name) or (GM and GM.Name) ) then --It's the current gamemode
Types = v.maps or "" --This is our prefix list
break
end
end
Types = string.Explode( "|", string.gsub( Types, "%^", "" ) ) --Split it to a table
for _,v in pairs(Types) do
local maps = file.Find( "maps/"..v.."*.bsp", "GAME" ) --Find maps with this prefix
table.Add( ValidMaps, maps ) --Combine it with our list
end[/lua]
Explicitly stating the prefixes seems unnecessary when the gamemode already does[/QUOTE]
I used to do it this way, but people were expecting to be able to include css maps in the vote aswell. I believe if you leave out the prefix argument it'll attempt to read from the gamemode's txt file, but it's pretty bad code past that point and I don't know if it'll work or not.
[CODE]23:14:44 Lua Error: [ERROR] gamemodes/terrortown/gamemode/init.lua:728: unexpected symbol near '<' 1. unknown - gamemodes/terrortown/gamemode/init.lua:0
23:14:44 Lua Error: Couldn't Load Init Script: 'terrortown/gamemode/init.lua'
23:14:44 Lua Error: [ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_phammer/shared.lua:50: attempt to call global 'AccessorFuncDT' (a nil value) 1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_phammer/shared.lua:50
23:14:44 Lua Error: [ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_push/shared.lua:50: attempt to call global 'AccessorFuncDT' (a nil value) 1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_push/shared.lua:50
23:14:44 Lua Error: [ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_wtester/shared.lua:70: attempt to call global 'AccessorFuncDT' (a nil value) 1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_wtester/shared.lua:70
23:14:44 Lua Error: [ERROR] gamemodes/terrortown/entities/weapons/weapon_tttbase/shared.lua:128: attempt to call global 'AccessorFuncDT' (a nil value) 1. unknown - gamemodes/terrortown/entities/weapons/weapon_tttbase/shared.lua:128
23:14:44 Lua Error: [ERROR] gamemodes/terrortown/entities/weapons/weapon_tttbasegrenade/shared.lua:59: attempt to call global 'AccessorFuncDT' (a nil value) 1. unknown - gamemodes/terrortown/entities/weapons/weapon_tttbasegrenade/shared.lua:59
23:14:44 server_cvar: "ttt_crowbar_pushforce" "395"
23:14:45 Lua Error: [ERROR] [/CODE]
big issue here, any help? restarted server, replaced init.lua using exact one in OP too
[QUOTE=Vexas;40695442][CODE]23:14:44 Lua Error: [ERROR] gamemodes/terrortown/gamemode/init.lua:728: unexpected symbol near '<' 1. unknown - gamemodes/terrortown/gamemode/init.lua:0
23:14:44 Lua Error: Couldn't Load Init Script: 'terrortown/gamemode/init.lua' [/CODE]
big issue here, any help? restarted server, replaced init.lua using exact one in OP too[/QUOTE]
You obviously did something wrong at line 728.
[QUOTE=Vexas;40695442][CODE]23:14:44 Lua Error: [ERROR] gamemodes/terrortown/gamemode/init.lua:728: unexpected symbol near '<' 1. unknown - gamemodes/terrortown/gamemode/init.lua:0
23:14:44 Lua Error: Couldn't Load Init Script: 'terrortown/gamemode/init.lua'
23:14:44 Lua Error: [ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_phammer/shared.lua:50: attempt to call global 'AccessorFuncDT' (a nil value) 1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_phammer/shared.lua:50
23:14:44 Lua Error: [ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_push/shared.lua:50: attempt to call global 'AccessorFuncDT' (a nil value) 1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_push/shared.lua:50
23:14:44 Lua Error: [ERROR] gamemodes/terrortown/entities/weapons/weapon_ttt_wtester/shared.lua:70: attempt to call global 'AccessorFuncDT' (a nil value) 1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_wtester/shared.lua:70
23:14:44 Lua Error: [ERROR] gamemodes/terrortown/entities/weapons/weapon_tttbase/shared.lua:128: attempt to call global 'AccessorFuncDT' (a nil value) 1. unknown - gamemodes/terrortown/entities/weapons/weapon_tttbase/shared.lua:128
23:14:44 Lua Error: [ERROR] gamemodes/terrortown/entities/weapons/weapon_tttbasegrenade/shared.lua:59: attempt to call global 'AccessorFuncDT' (a nil value) 1. unknown - gamemodes/terrortown/entities/weapons/weapon_tttbasegrenade/shared.lua:59
23:14:44 server_cvar: "ttt_crowbar_pushforce" "395"
23:14:45 Lua Error: [ERROR] [/CODE]
big issue here, any help? restarted server, [B][I][U]replaced init.lua using exact one in OP too[/U][/I][/B][/QUOTE]
[B][I][U]replaced init.lua using exact one in OP too[/U][/I][/B]
ontop of that, heres 724-740 of init.lua
[CODE] end
if switchmap then
timer.Stop("end2prep")
MapVote.Start(15, false, 24, "ttt_")
elseif ShouldMapSwitch() then
LANG.Msg("limit_left", {num = rounds_left,
time = math.ceil(time_left / 60),
mapname = "chosen by a vote"})
end
end
function EndRound(type)
PrintResultMessage(type)
-- first handle round end
SetRoundState(ROUND_POST)[/CODE]
As a couple people stated, it would be great to have map cooldown. Votes on the server go from Dolls - Rooftop - 67th way and repeat. If you could put this in, it would be amazing.
Anyone with NFO get this to work?
[QUOTE=Vexas;40706975]Anyone with NFO get this to work?[/QUOTE]
I use nfo, Idk why host would matter though.
[QUOTE=Eccid;40710520]I use nfo, Idk why host would matter though.[/QUOTE]
It doesn't, unless a script requires dlls and your host wont allow any.
Awesome work, I added you on steam "sabo" because I need some help with this, hopefully you can help me out!
Thanks again for sharing this with us all.:zoid:
Good quality release like always, well done
Ok, so heres my issue, talked with Willox for a while on this and couldn't find a solution:
(Copy and pasting from other threads made)
[QUOTE]I have a modified init.lua (located in /garrysmod/gamemodes/terrortown/gamemode). The default init.lua was deleted, moved, and hidden in a different folder. The edited init.lua has been moved and replaced. However, when there is no init.lua present, the server will not start in gamemode Terrortown (so it obviously has some impact).
The issue here is that the server is loading the default init.lua when it is not even on the server- only the modified one is.
Thanks in advance.[/QUOTE]
I changed the old init.lua and it doesn't work, basically.
[QUOTE=Ambro;40610450]Willox, Just wanted to contribute to your awesome votemap addon, thanks again for this great addition :)
The below is a really simple bit of code I've added which will allow you to use ULX to initiate and cancel a votemap through your system.
[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][/QUOTE]
!unmapvote does not work.
Another question: How do I add the command to the xgui_menu (!menu) in ULX?
Odd, unless something changed with how MapVote.Cancel() works, it should work just fine, I'll re-test once I'm home today.
To add this to the ULX menu, at the top of this file, lets say you've named it mapvote.lua in the following directory: "addons/ulxmapvote/lua/ulx/modules/sh/mapvote.lua"
Inside the file at the top, declare CATEGORY_NAME like this,
[code]
local CATEGORY_NAME = "MapVote"
[/code]
Since the ulx.command is already pointing to the "CATEGORY_NAME" local, it will create a new ulx menu item named MapVote or whatever you specify for the category name local.
I used the !unmapvote which did not work.
But the unmapvote in the ULX xgui menu works for some odd reason.
I can not really help you find the problem because I get 0 Errors :(
But it works if the command is included in the !menu :)
Thanks for this addon bro!
[QUOTE=sab0tage3;40754629]I used the !unmapvote which did not work.
But the unmapvote in the ULX xgui menu works for some odd reason.
I can not really help you find the problem because I get 0 Errors :(
But it works if the command is included in the !menu :)[/QUOTE]
Tested on my end, not experiencing that issue in chat, !unmapvote is working as expected, what version of ULX are you using?
[QUOTE=Ambro;40760651]Tested on my end, not experiencing that issue in chat, !unmapvote is working as expected, what version of ULX are you using?[/QUOTE]
3.60
Another great release from Willox!
Sorry, you need to Log In to post a reply to this thread.