View Single Post
Cruze
Veteran Member
Join Date: May 2017
Old 08-11-2021 , 13:11   Re: [CS:GO] Custom Votes [Panorama] (v1.0 | 9 August 2021)
Reply With Quote #13

Quote:
Originally Posted by NanoC View Post
It doesn't matter. It'd be really cool.
Something like !customvote "extend the current map?", etc
PHP Code:
#include <sourcemod>
#include <cstrike>
#include <customvotes>

#define MAX_SIZE 256

public void OnPluginStart()
{
    
RegConsoleCmd("sm_customvote"Command_CustomVote);
}

public 
Action Command_CustomVote(int clientint args)
{
    if (
CustomVotes_IsVoteInProgress())
    {
        return 
Plugin_Handled;
    }
    
    
char sBuffer[MAX_SIZE];
    
    
GetCmdArgString(sBufferMAX_SIZE);
    
    
ReplaceString(sBufferMAX_SIZE"\\n""<br>");
    
    
Format(sBufferMAX_SIZE"<font color='#FF5500' class='fontSize-xxxl'>%s?</font>"sBuffer);
    
    
CustomVoteSetup setup;
    
    
setup.team CS_TEAM_NONE;
    
setup.initiator client;
    
setup.issue_id VOTE_ISSUE_UNPAUSEMATCH;
    
setup.dispstr sBuffer;
    
setup.disppass "<font color='#3df218'>Vote Passed!</font>";

    
CustomVotes_Execute(setup15Handler_CustomVotePassedHandler_CustomVoteFailed);

    return 
Plugin_Handled;


public 
void Handler_CustomVotePassed(int results[MAXPLAYERS+1])
{
    
//PrintToChatAll("[SM] Vote Passed.");
}

public 
void Handler_CustomVoteFailed(int results[MAXPLAYERS+1])
{
    
//PrintToChatAll("[SM] Vote Failed.");

__________________
Taking paid private requests! Contact me
Cruze is offline