Back to TPG

TPG.Voting.StartMapVote

S🏷️ Voting

Part of TPG namespace

TPG.Voting.StartMapVote()
View on GitHub|gamemode/voting/sv_voting.lua:153-231
📋 Has LDoc👁️ 0 viewsUpdated 1 month ago

Description

Open the end-of-round map vote: pick candidates, sync them to clients, and schedule the whole vote's lifecycle with timer.Simple. Candidates are drawn without replacement from TPG.Voting.MapLists.Open and .Urban per TPG.Config.mapVoteSlots (default { open = 3, urban = 2, bonus = 1 }), each tagged with its category (1=Open, 2=Urban, 3=Bonus) so the vote screen can label the card. The bonus slot draws from whatever is left of BOTH pools after Open/Urban picks are removed, so it can never repeat a map already offered. If a pool runs out early its remaining slots are simply skipped -- the candidate list can come back shorter than the slot config asked for. Schedules, all via timer.Simple relative to TPG.Config.mapVoteTime: opening every player's vote menu (tpg_menu_mapvote -- deferred 0.25s so the synced map data has already arrived), a 10s-left and 5s-left chat countdown, and the final call to TPG.Voting.TallyVotes one second after the window closes. None of these timers are named, so calling this again before they fire stacks a second full set rather than replacing the first.

Parameters

No parameters.

Returns

No return values documented.

Examples

No examples available.

Used In

No usages found in the codebase.