1#pragma once
2
3// ================================================
4//  Declarations for the vote system/vote commands
5//  Last updated: December 14th, 2011
6// ================================================
7
8// definitions for command selection between progs
9const float VC_ASGNMNT_BOTH = 1;
10const float VC_ASGNMNT_CLIENTONLY = 2;
11const float VC_ASGNMNT_SERVERONLY = 3;
12
13// vote selection definitions
14const float VOTE_SELECT_ABSTAIN = -2;
15const float VOTE_SELECT_REJECT = -1;
16const float VOTE_SELECT_NULL = 0;
17const float VOTE_SELECT_ACCEPT = 1;
18
19// different statuses of the current vote
20const float VOTE_NULL = 0;
21const float VOTE_NORMAL = 1;
22const float VOTE_MASTER = 2;
23
24// global vote information declarations
25entity vote_caller;         // original caller of the current vote
26string vote_caller_name;    // name of the vote caller
27float vote_called;          // stores status of current vote (See VOTE_*)
28float vote_endtime;         // time when the vote is finished
29float vote_accept_count;    // total amount of players who accept the vote (counted by VoteCount() function)
30float vote_reject_count;    // same as above, but rejected
31float vote_abstain_count;   // same as above, but abstained
32float vote_needed_overall;  // total amount of players NEEDED for a vote to pass (based on sv_vote_majority_factor)
33.float vote_master;         // flag for if the player has vote master privelages
34.float vote_waittime;       // flag for how long the player must wait before they can vote again
35.float vote_selection;      // flag for which vote selection the player has made (See VOTE_SELECT_*)
36string vote_called_command; // command sent by client
37string vote_called_display; // visual string of command sent by client
38string vote_parsed_command; // command which is fixed after being parsed
39string vote_parsed_display; // visual string which is fixed after being parsed
40
41// allow functions to be used in other code like g_world.qc and teamplay.qc
42void VoteThink();
43void VoteReset();
44void VoteCommand(float request, entity caller, float argc, string vote_command);
45
46// warmup and nagger stuff
47const float RESTART_COUNTDOWN = 10;
48entity nagger;
49float readycount;                  // amount of players who are ready
50float readyrestart_happened;       // keeps track of whether a restart has already happened
51float restart_mapalreadyrestarted; // bool, indicates whether reset_map() was already executed
52.float ready;                      // flag for if a player is ready
53void reset_map(float dorespawn);
54void ReadyCount();
55void ReadyRestart_force();
56void VoteCount(float first_count);
57