Raised This Month: $12 Target: $400
 3% 

CS:GO No round termination on 0:00 but start new one when all die


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iGANGNAM
AlliedModders Donor
Join Date: Sep 2012
Location: Lithuania
Old 12-24-2014 , 05:18   CS:GO No round termination on 0:00 but start new one when all die
Reply With Quote #1

Here is my code. I need to prevent round end on 0:00 for minigames server and I have tried on player death + mp_ignore_round_win_conditions 1 and then force to end it but round doesn't stop + all dead
This one what I try is OnTerminateRound ofc I MODE 2 is not necessary i know just look after mode 1.. I think this plugin would help a lot servers that run minigames, I saw many threads with no solutions.

Help me please
PHP Code:
#include <sourcemod>
#include <cstrike>

new Handle:sm_enabled INVALID_HANDLE;
new 
Handle:sm_mode INVALID_HANDLE;

public 
Plugin:myinfo 
{
    
name "[CS:GO] No round termination on 0:00",
    
author "iGANGNAM",
    
description "Round should not terminated on 0:00 for CS:GO",
    
version "1.0",
    
url ""
}

public 
OnPluginStart()
{

    
CreateConVar("sm_nrt_version""1.0""No round terminination on 0:00 version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
sm_enabled CreateConVar("sm_ntr_enabled""1""Enables this plugin; 0 - disabled, 1 - enabled");
    
sm_mode CreateConVar("sm_ntr_mode""1""Set up when round will be terminated; 1 - when last person dies, 2 - When only one is team alive");
    
}

public 
Action:CS_OnTerminateRound(&Float:delay, &CSRoundEndReason:reason)
{
    if(
reason == CSRoundEnd_GameStart)
    return 
Plugin_Continue;
    
    if (
GetConVarInt(sm_enabled) == 1)
    {
        
        
//Was a reason other than CT win passed? If so, we gotta fix that shit.
        
if(reason == CSRoundEnd_Draw)
        {
            
            new 
count 0;
            new 
ct 0;
            new 
terr 0;
            
            for(new 
<= GetMaxClients();i++)
            {
                if(
IsPlayerAlive(i) && IsClientInGame(i))
                {
                    new 
team GetClientTeam(i);
                    
count++;
                    if ( 
team == CS_TEAM_CT) {
                        
ct++;
                    } else if (
team == CS_TEAM_T) {
                        
terr++;
                    }
                } 
            }
            new 
val GetConVarInt(sm_mode);
            
            if (
val == 1) {
                if (
count == 0) {
                    return 
Plugin_Continue;
                }
            } else if ( 
val == 2) {

                if (
count != 0) {
                    
                    if (
ct == 0) {
                        
reason CSRoundEnd_TerroristWin
                        return 
Plugin_Changed
                    } else if ( 
terr == 0) {
                        
reason CSRoundEnd_CTWin
                        return 
Plugin_Changed
                    }
                    
                }
            }
        }
    
    }

    return 
Plugin_Continue;


Last edited by iGANGNAM; 12-24-2014 at 05:38.
iGANGNAM is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 12-24-2014 , 05:24   Re: CS:GO No round termination on 0:00 but start new one when all die
Reply With Quote #2

mp_ignore_round_win_conditions 1 Reqiures sv_cheats probably
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube is offline
iGANGNAM
AlliedModders Donor
Join Date: Sep 2012
Location: Lithuania
Old 12-24-2014 , 05:37   Re: CS:GO No round termination on 0:00 but start new one when all die
Reply With Quote #3

Quote:
Originally Posted by Michalplyoutube View Post
mp_ignore_round_win_conditions 1 Reqiures sv_cheats probably
No. it doesn't.

"mp_ignore_round_win_conditions","1",,,"GAMED LL",,,,,,,,"REPLICATED",,,,,,,,,,"Ignore conditions which would end the current round"

Last edited by iGANGNAM; 12-24-2014 at 05:43.
iGANGNAM is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 12-24-2014 , 05:53   Re: CS:GO No round termination on 0:00 but start new one when all die
Reply With Quote #4

Quote:
Originally Posted by iGANGNAM View Post
No. it doesn't.

"mp_ignore_round_win_conditions","1",,,"GAMED LL",,,,,,,,"REPLICATED",,,,,,,,,,"Ignore conditions which would end the current round"
Extend round timer?
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube is offline
iGANGNAM
AlliedModders Donor
Join Date: Sep 2012
Location: Lithuania
Old 12-24-2014 , 06:02   Re: CS:GO No round termination on 0:00 but start new one when all die
Reply With Quote #5

Quote:
Originally Posted by Michalplyoutube View Post
Extend round timer?
I don't want it to be forever. + I have jailbreak server, one of rules when 0:00 comes there should be free day.

Last edited by iGANGNAM; 12-24-2014 at 06:03.
iGANGNAM 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 20:04.


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