View Single Post
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 01-03-2021 , 20:16   Re: [CS:GO] Overtime Plugin request
Reply With Quote #6

Quote:
Originally Posted by Flex1z View Post
But that's not the point of the plugin at all. I'm trying to let the players vote for overtime when round 28 starts with the menu. If that works get more then 50% yes to have overtime otherwise a draw. With just typing !OT you instantly active overtime which I'm not trying to achieve.
Try that
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>

#pragma semicolon 1
#pragma newdecls required

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

public 
Action Event_RoundStart(Event evEvent, const char[] szNamebool bDontBroadcast)
{
    
int CurrentRoundNum GetTeamScore(CS_TEAM_T) + GetTeamScore(CS_TEAM_CT);
    
    if(
CurrentRoundNum == 28) {
        
DoVoteMenu();
    }   
}  

public 
int Handle_VoteMenu(Menu menuMenuAction actionint param1int param2)
{
    if (
action == MenuAction_End)
        
delete menu;
}

 public 
void VoteResultCallback(Menu menuint num_votesint num_clients, const int[][] client_infoint num_items, const int[][] item_info)
{
    
char item[16];
    
menu.GetItem(item_info[0][VOTEINFO_ITEM_INDEX], itemsizeof(item)); 
    if (
StrEqual(item"yes"false))
    {
        
ServerCommand("mp_overtime_enable 1");
    }
}

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

__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:
SSheriFF is offline