Raised This Month: $32 Target: $400
 8% 

Force Match END and select a winner Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
easytutz
Junior Member
Join Date: Mar 2021
Old 05-14-2021 , 10:04   Force Match END and select a winner Plugin
Reply With Quote #1

I need a plugin which force end match and select a winner through command like sm_winner "CT/T"
and show in scoreboard just like match ends when a winner win or 16 rounds finished.
easytutz is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 05-15-2021 , 05:35   Re: Force Match END and select a winner Plugin
Reply With Quote #2

PHP Code:

#pragma newdecls required

#include <sourcemod>
#include <sdktools>
#include <cstrike>

ConVar g_Cvar_MaxRounds;
ConVar g_Cvar_Timelimit;
ConVar g_Cvar_RoundRestartDelay;

public 
void OnPluginStart()
{
    
g_Cvar_MaxRounds FindConVar("mp_maxrounds");
    
g_Cvar_Timelimit FindConVar("mp_timelimit");
    
g_Cvar_RoundRestartDelay FindConVar("mp_round_restart_delay");
    
    
RegConsoleCmd("sm_winner"Command_Winner);
}

public 
Action Command_Winner(int clientint args)
{
    
char arg[64];
    
GetCmdArg(1argsizeof(arg));
    
    if (
StrEqual(arg"T"false))
    {
        
EndGame(CS_TEAM_T);
    }
    else if (
StrEqual(arg"CT"false))
    {
        
EndGame(CS_TEAM_CT);
    }
    
    return 
Plugin_Handled;
}

void EndGame(int winner)
{
    if (
winner == CS_TEAM_T)
    {
        
CS_SetTeamScore(CS_TEAM_Tg_Cvar_MaxRounds.IntValue 2);
        
SetTeamScore(CS_TEAM_Tg_Cvar_MaxRounds.IntValue 2);
        
        
CS_SetTeamScore(CS_TEAM_CT0);
        
SetTeamScore(CS_TEAM_CT0);
        
        
CS_TerminateRound(g_Cvar_RoundRestartDelay.FloatValueCSRoundEnd_TerroristWin);
    }
    else
    {
        
CS_SetTeamScore(CS_TEAM_CTg_Cvar_MaxRounds.IntValue 2);
        
SetTeamScore(CS_TEAM_CTg_Cvar_MaxRounds.IntValue 2);
        
        
CS_SetTeamScore(CS_TEAM_T0);
        
SetTeamScore(CS_TEAM_T0);
        
        
CS_TerminateRound(g_Cvar_RoundRestartDelay.FloatValueCSRoundEnd_CTWin);
    }
    
    
g_Cvar_Timelimit.SetInt(1);

__________________
Ilusion9 is offline
easytutz
Junior Member
Join Date: Mar 2021
Old 05-15-2021 , 15:12   Re: Force Match END and select a winner Plugin
Reply With Quote #3

Thank you so much , it worked
easytutz 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 12:55.


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