TPG.Voting.CastMapVote(ply, mapIndex)📋 Has LDoc👁️ 0 viewsUpdated 1 month ago
Description
Record (or change) ply's vote for a map-vote candidate and broadcast the new tally. mapIndex is whatever the client's tpg_votemap concommand sent -- an unchecked number from the player. It is safe here only because the lookup is bounds-checked: TPG.State.voting.maps[mapIndex] returns nil for anything out of range and the function returns immediately, so a forged index can neither crash the server nor vote for a map that isn't a candidate. No-ops entirely while no vote is active.
Parameters
| Name | Type | Description |
|---|---|---|
ply | Player | The voter. |
mapIndex | number | Index into `TPG.State.voting.maps`, 1-based. |
Returns
No return values documented.
Examples
No examples available.
Used In
No usages found in the codebase.