• Need to allow for mapvote at end of round for Hide and Seek
    2 replies, posted
[B]Hide and Seek init.lua:[/B] [url]http://paste.ubuntu.com/8157187/[/url] 58-96 is where I think it needs to be changed but I'm not sure. My map vote I use, uses function FC_VOTE.StartVote()
Line 95: [code]timer.Simple(15,function() game.LoadNextMap() end)[/code] Comment that out so it doesn't change the map automatically. 90-94: [code] timer.Simple(5,function() for k,v in pairs(player.GetAll()) do v:SendLua([[if not ScoBIsShowing then ScoBShow() end]]) end end)[/code] Comment that out so the scoreboard doesn't cover the map-vote. 87-89: [code] for k,v in pairs(player.GetAll()) do v:SendLua([[chat.AddText(Color(255,255,255),"Let's go to the next map: ]]..nxmap..[[")]]) end[/code] Comment that out so the chat isn't spammed before the map vote is done. [B]Alternatively - after seeing line 84 there is an easier way:[/B] 84: [code]local scont = hook.Call("HASGameEnded",GAMEMODE,winner)[/code] Add a hook: [code]hook.Add( "HASGameEnded", "StartMapVoteAtEndOfGame", function( _winner ) // Start the vote FC_VOTE.StartVote( ); // Return true to prevent default map change. return true; end );[/code] The hook would be the better option assuming the map vote system takes care of changing the map for you.
[QUOTE=Acecool;45813752]Line 95: [code]timer.Simple(15,function() game.LoadNextMap() end)[/code] Comment that out so it doesn't change the map automatically. 90-94: [code] timer.Simple(5,function() for k,v in pairs(player.GetAll()) do v:SendLua([[if not ScoBIsShowing then ScoBShow() end]]) end end)[/code] Comment that out so the scoreboard doesn't cover the map-vote. 87-89: [code] for k,v in pairs(player.GetAll()) do v:SendLua([[chat.AddText(Color(255,255,255),"Let's go to the next map: ]]..nxmap..[[")]]) end[/code] Comment that out so the chat isn't spammed before the map vote is done. [B]Alternatively - after seeing line 84 there is an easier way:[/B] 84: [code]local scont = hook.Call("HASGameEnded",GAMEMODE,winner)[/code] Add a hook: [code]hook.Add( "HASGameEnded", "StartMapVoteAtEndOfGame", function( _winner ) // Start the vote FC_VOTE.StartVote( ); // Return true to prevent default map change. return true; end );[/code] The hook would be the better option assuming the map vote system takes care of changing the map for you.[/QUOTE] i did exact that but didnt work? i rlly need help with mapvote it only restart the same map all time, i tried to use shout vote doesnt work i tried [url]https://facepunch.com/showthread.php?t=1268353&highlight=hide+seek[/url] but its ttt didnt work. HALP
Sorry, you need to Log In to post a reply to this thread.