View Single Post
KoNLiG
AlliedModders Donor
Join Date: Sep 2020
Location: Israel
Old 08-14-2021 , 07:37   Re: [CS:GO] Custom Votes [Panorama] (v1.0 | 9 August 2021)
Reply With Quote #15

'results[MAXPLAYERS+1]' stores the clients vote decisions by this enum (located in customvotes.inc):
Code:
/**
 * Client's custom vote decisions.
 */
enum
{
	VOTE_DECISION_NONE = -1,
	VOTE_DECISION_YES,
	VOTE_DECISION_NO
}
So for example, if you want to know what each player voted for it'd be like this:
Code:
public void Handler_CustomVotePassed(int results[MAXPLAYERS + 1])
{
	for (int current_client = 1; current_client <= MaxClients; current_client++)
	{
		// If the current client isn't in game, results[current_client] will always be 'VOTE_DECISION_NONE'.
		if (IsClientInGame(current_client))
		{
			switch (results[current_client])
			{
				// Didn't vote at all.
				case VOTE_DECISION_NONE:
				{
					
				}
				// Voted positively.
				case VOTE_DECISION_YES:
				{
					
				}
				// Voted negatively.
				case VOTE_DECISION_NO:
				{
					
				}
			}
		}
	}
}
__________________
For questions/plugin requests contact me:

• Discord: KoNLiG#6417
• Steam: KoNLiG
KoNLiG is offline