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_RoundStart, EventHookMode_Post);
RegConsoleCmd("test_command", Command_Test);
}
public Action Command_Test(int client, int args)
{
DoVoteMenu();
}
public Action Event_RoundStart(Event evEvent, const char[] szName, bool 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 menu, MenuAction action, int param1, int param2)
{
char buffer[64], display[64];
menu.GetItem(param1, buffer, sizeof(buffer), _, display, sizeof(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);
}