I am trying to get the mapvote to pop up after 12 rounds but I have had little to no luck. The addon that I am using is [url]http://steamcommunity.com/sharedfiles/filedetails/?id=151583504[/url]
[url]https://github.com/tyrantelf/gmod-mapvote#ttt-and-deathrun-setup[/url]
I have already read through the github page and I didnt find it very helpful.
Thank you in advance to anyone who offers support and help :)
I just checked out the murder code, it has a hook OnEndRound for when it ends the round, I suggest just copying the deathrun code and making it work for murder, for example just after line 41 in the rtv file you could paste this
[CODE]
elseif GAMEMODE_NAME == "murder" then
net.Start("RTV_Delay")
net.Broadcast()
hook.Add("OnEndRound", "MapvoteDelayed", function()
MapVote.Start(nil, nil, nil, nil)
end)
[/CODE]
And also change the code in the sv_autovote file from
this:
[CODE]
if GAMEMODE_NAME == "deathrun" then
function RTV.Start()
MapVote.Start(nil, nil, nil, nil)
end
end
[/CODE]
to this:
[CODE]
if GAMEMODE_NAME == "deathrun" || GAMEMODE_NAME == "murder" then
function RTV.Start()
MapVote.Start(nil, nil, nil, nil)
end
end
[/CODE]
Just tested, the above code works, you just need to set mu_roundlimit and your good.
would this work fine?
[lua]if GAMEMODE_NAME == "murder" then
function RTV.Start()
MapVote.Start(nil, nil, nil, nil)
end
end[/lua]
[QUOTE=Baron von Hax;44385763]would this work fine?
[lua]if GAMEMODE_NAME == "murder" then
function RTV.Start()
MapVote.Start(nil, nil, nil, nil)
end
end[/lua][/QUOTE]
If your replacing "deathrun" with "murder" yes it should work fine, I added an or statement for murder just in case you would ever use it for deathrun and wanted to keep the deathrun rtv working.
Also make sure your adding the first bit of code to rtv.lua
I put the murder convar for the roundlimit in and it doesn't work.
[b]Server.cfg[/b]
[code]
// Server Configuration
hostname "Baron's Island Murder|Pointshop|Minimap|" // Your Server Hostname Here.
//NOTICE:
//Only remove PlugPayPlay.com | if you have paid for a NON branded server.
//If you remove this and have not paid for it you will not be able to start your server!
sv_password "" // Your Server Password Here.
rcon_password "*password*" // Your Rcon Password Here.
gamemode "murder" // // Set your gamemode here.
sv_loadingurl baron-von-haxor.com/FinalV102/index.php?steamid=%s
//FastDL
sv_downloadurl "$[FastDownloadBaseUrl]"
sv_allowdownload "1"
sv_allowupload "0"
// LUA
sv_kickerrornum 0 // Disables LUA errors.
// Murder
mu_halo_render 0
mu_footstep_maxlifetime 0
mu_roundlimit 4[/code]
Okay, so you have the rtv addon in addons, in the folder lua\mapvote\rtv.lua
your RTV.Start() function looks like this
[CODE]
function RTV.Start()
if GAMEMODE_NAME == "terrortown" then
net.Start("RTV_Delay")
net.Broadcast()
hook.Add("TTTEndRound", "MapvoteDelayed", function()
MapVote.Start(nil, nil, nil, nil)
end)
elseif GAMEMODE_NAME == "deathrun" then
net.Start("RTV_Delay")
net.Broadcast()
hook.Add("RoundEnd", "MapvoteDelayed", function()
MapVote.Start(nil, nil, nil, nil)
end)
elseif GAMEMODE_NAME == "murder" then
net.Start("RTV_Delay")
net.Broadcast()
hook.Add("OnEndRound", "MapvoteDelayed", function()
MapVote.Start(nil, nil, nil, nil)
end)
else
PrintMessage( HUD_PRINTTALK, "The vote has been rocked, map vote imminent")
timer.Simple(4, function()
MapVote.Start(nil, nil, nil, nil)
end)
end
end
[/CODE]
your lua\autorun\server\sv_autovote.lua looks like this
[CODE]
hook.Add( "Initialize", "AutoTTTMapVote", function()
if GAMEMODE_NAME == "terrortown" then
function CheckForMapSwitch()
-- Check for mapswitch
local rounds_left = math.max(0, GetGlobalInt("ttt_rounds_left", 6) - 1)
SetGlobalInt("ttt_rounds_left", rounds_left)
local time_left = math.max(0, (GetConVar("ttt_time_limit_minutes"):GetInt() * 60) - CurTime())
local switchmap = false
local nextmap = string.upper(game.GetMapNext())
if rounds_left <= 0 then
LANG.Msg("limit_round", {mapname = nextmap})
switchmap = true
elseif time_left <= 0 then
LANG.Msg("limit_time", {mapname = nextmap})
switchmap = true
end
if switchmap then
timer.Stop("end2prep")
MapVote.Start(nil, nil, nil, nil)
end
end
end
if GAMEMODE_NAME == "deathrun" || GAMEMODE_NAME == "murder" then
function RTV.Start()
MapVote.Start(nil, nil, nil, nil)
end
end
end )
[/CODE]
Also, what happens after the 4 rounds?
EDIT:
[IMG]http://i.imgur.com/816IZd3.jpg[/IMG]
Works fine....
(Ignore the error in the top left, that's a different addon causing the error)
I've edited the files that you said :)
Also, nothing happens after the 4th round, it just continues
[QUOTE=Baron von Hax;44390362]I've edited the files that you said :)
Also, nothing happens after the 4th round, it just continues[/QUOTE]
Oh, your autorun is running before the gamemode is loaded probably, put your murder related code in server.cfg
Sorry if this is a stupid question, but how would I go about doing this? I'm reluctant to ask since it seems like you're spoon-feeding me every detail and it's not making me look very clever xD
garrysmod/cfg/server.cfg
inside that just add
mu_roundlimit 4
and you're done :)
Oh that was already in there but it isnt working for some reason :P
[QUOTE=Baron von Hax;44391113]Oh that was already in there but it isnt working for some reason :P[/QUOTE]
:/ How are you changing gamemode? through console or does it change on startup?
Its in the start parameters. I'm not sure why my hosts included the option in the server.cfg
[QUOTE=Baron von Hax;44394834]Its in the start parameters. I'm not sure why my hosts included the option in the server.cfg[/QUOTE]
Well... I don't know much about how the server loads up and stuff
but there is still a way for it to always be 4 rounds, it's not the right way to do it, but you can go into the code and manually set it to always be 4 hardcoded
goto:
Server\garrysmod\gamemodes\murder\gamemode
open init.lua
goto line 47 and change
[CODE]
GM.RoundLimit = CreateConVar("mu_roundlimit", 0, bit.bor(FCVAR_NOTIFY), "Number of rounds we should play before map change" )
[/CODE]
to
[CODE]
GM.RoundLimit = CreateConVar("mu_roundlimit", 4, bit.bor(FCVAR_NOTIFY), "Number of rounds we should play before map change" )
[/CODE]
are they not exactly the same?
[QUOTE=Baron von Hax;44395889]are they not exactly the same?[/QUOTE]
Omg yes sorry, I edited it
Ah thank you :) I'll try this soon
When I got round to doing this, only one map appears at a time.
This is my cfg:
[code]{"RTVPlayerCount":3,"MapLimit":24,"TimeLimit":28,"AllowCurrentMap":false,"MapPrefixes":{"1":"ttt_","2":"cs_","3":"de_","4":"dm_","5":"md_"},"MapsBeforeRevote":12,"EnableCooldown":true}[/code]
[QUOTE=Baron von Hax;44461501]When I got round to doing this, only one map appears at a time.
This is my cfg:
[code]{"RTVPlayerCount":3,"MapLimit":24,"TimeLimit":28,"AllowCurrentMap":false,"MapPrefixes":{"1":"ttt_","2":"cs_","3":"de_","4":"dm_","5":"md_"},"MapsBeforeRevote":12,"EnableCooldown":true}[/code][/QUOTE]
What maps do you have? What maps show up?
[editline]5th April 2014[/editline]
You might be doing something different to what your meant to, I believe you're meant to edit the mapvote.lua in lua\autorun
I believe you are meant to edit this
[CODE]
MapVoteConfigDefault = {
MapLimit = 24,
TimeLimit = 28,
AllowCurrentMap = false,
EnableCooldown = true,
MapsBeforeRevote = 3,
RTVPlayerCount = 3,
MapPrefixes = {"ttt_"}
}
[/CODE]
I seem to be having the same issue as above.
The rtv and sv_autovote lua files are literally the same as quoted above and I have set a map round limit of 2 (for debug) in the server.cfg
After the 2 rounds, the game will stick on the current round and not start a new one and the map vote will not pop up.
RTV command seems to work fine as it will come up that you have rocked the vote but after the round if will freeze and no map vote screen will come up.
Also no errors come up in console.
Sorry, you need to Log In to post a reply to this thread.