let users be able to votemap without instant map change and a heads up

This commit is contained in:
edshot99 2024-03-25 02:18:11 -05:00
parent fc73984f95
commit d4981eefa9

View File

@ -46,6 +46,7 @@ function ulx.votemapVeto( calling_ply )
end
timer.Remove( "ULXVotemap" )
timer.Remove( "ULXVotemapNotice" )
ulx.timedVeto = nil
hook.Call( ulx.HOOK_VETO )
ULib.tsay( _, "Votemap changelevel halted.", true )
@ -154,7 +155,7 @@ function ulx.votemap( calling_ply, map )
end
end
if #admins <= 0 or vetotime < 1 then
if vetotime < 1 then
ULib.tsay( _, "Vote for map " .. ulx.votemaps[ mapid ] .. " successful! Changing levels now.", true ) -- TODO, color?
ulx.logString( "Votemap for " .. ulx.votemaps[ mapid ] .. " won." )
game.ConsoleCommand( "changelevel " .. ulx.votemaps[ mapid ] .. "\n" )
@ -166,6 +167,12 @@ function ulx.votemap( calling_ply, map )
ulx.logString( "Votemap for " .. ulx.votemaps[ mapid ] .. " won. Pending admin veto." )
ulx.timedVeto = true
hook.Call( ulx.HOOK_VETO )
ulx.csay(calling_ply, "====== MAP CHANGE IN: " .. vetotime .. " SECOND(S) ======")
local vetotime2 = vetotime - 1
timer.Create( "ULXVotemapNotice", 1, vetotime2, function()
ulx.csay(calling_ply, "====== MAP CHANGE IN: " .. vetotime2 .. " SECOND(S) ======")
vetotime2 = vetotime2 - 1
end )
timer.Create( "ULXVotemap", vetotime, 1, function() game.ConsoleCommand( "changelevel " .. ulx.votemaps[ mapid ] .. "\n" ) end )
end
end