Raised This Month: $ Target: $400
 0% 

[CS:GO] Overtime Voter


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Flex1z
Junior Member
Join Date: Dec 2020
Old 12-31-2020 , 20:34   [CS:GO] Overtime Voter
Reply With Quote #1

Hello, I've found a plugin that allows you to vote for overtime or not. I've compiled the plugin without any errors.
I just tested this plugin but it did not seem to work (nothing happened after playing 30 rounds).
I want to have it so at round 28 it gives you the option to vote for overtime (yes or no).
The code is down below, could someone help me with this please.

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>

#pragma semicolon 1
#pragma newdecls required

public void OnPluginStart() 
{
    
HookEvent("round_start"Event_RoundStartEventHookMode_Post);
    
RegConsoleCmd("test_command"Command_Test);
}


public 
Action Command_Test(int clientint args)

    
DoVoteMenu();
}

public 
Action Event_RoundStart(Event evEvent, const char[] szNamebool bDontBroadcast)
{
    
int CurrentRoundNum GetTeamScore(CS_TEAM_T) + GetTeamScore(CS_TEAM_CT);
    
    if(
CurrentRoundNum 28 != 0) {
        return;
    }
    
    
    
PrintToChatAll("Round %d Test message."CurrentRoundNum);
}  



public 
int Handle_VoteMenu(Menu menuMenuAction actionint param1int param2)
{
    
char buffer[64], display[64];
    
menu.GetItem(param1buffersizeof(buffer), _displaysizeof(display));

    if (
action == MenuAction_End)
    {
        
delete menu;
    } 
    else if (
action == MenuAction_VoteEnd
    {
        if (
param1 == 0)
        {
            
//menu.GetItem(param1);
            
ServerCommand("mp_overtime_enable 1");
        }
    }
}

 
void DoVoteMenu()
{
    if (
IsVoteInProgress())
    {
        return;
    }
 
    
Menu menu = new Menu(Handle_VoteMenu);
    
menu.SetTitle("Should there be an overtime?");
    
menu.AddItem("yes""Yes");
    
menu.AddItem("no""No");
    
menu.ExitButton false;
    
menu.DisplayVoteToAll(20);

Flex1z is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode