This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[CS:GO] Disable round restarts when player joins empty team.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
infinite_
SourceMod Donor
Join Date: Mar 2015
Old 03-30-2015 , 01:46   [CS:GO] Disable round restarts when player joins empty team.
Reply With Quote #1

The plugin I'm writing requires the round to not be restarted in a situation where one player is alone in the server and another player joins. "Game will start when both teams have players" is outputted in console at this time, and normally when a second player joins, the round restarts, disrupting what the player who was in the server alone was doing. I searched around hoping there would be a simple ConVar to disable this, and if there is I didn't find it. Is there any way to disable this using SM?

I have these possibly relevant ConVars set:
Quote:
mp_ignore_round_win_conditions 1
mp_do_warmup_period 0
mp_autoteambalance 0
Thanks

Last edited by infinite_; 03-30-2015 at 01:57.
infinite_ is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 03-30-2015 , 02:09   Re: [CS:GO] Disable round restarts when player joins empty team.
Reply With Quote #2

U do require a plugin that cancels the on terminate round event.
__________________
Neuro Toxin is offline
infinite_
SourceMod Donor
Join Date: Mar 2015
Old 03-30-2015 , 02:20   Re: [CS:GO] Disable round restarts when player joins empty team.
Reply With Quote #3

Quote:
Originally Posted by Neuro Toxin View Post
U do require a plugin that cancels the on terminate round event.
Do you know of a plugin that does, or how to write one? I see you manage surf servers and the plugin I am writing is a surf timer.

Last edited by infinite_; 03-30-2015 at 02:23.
infinite_ is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 03-30-2015 , 03:02   Re: [CS:GO] Disable round restarts when player joins empty team.
Reply With Quote #4

When I get home ill pass the code I'm using.

Eta 20 mins
__________________
Neuro Toxin is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 03-30-2015 , 03:26   Re: [CS:GO] Disable round restarts when player joins empty team.
Reply With Quote #5

This is really rough, however it will help you on your way.

InWarmup is a global that is set when in a warmup round.

If you don't check this, warmup will never end.

Code:
public Action:CS_OnTerminateRound(&Float:delay, &CSRoundEndReason:reason)
{
    PrintToChatAll("[SM] CS_OnTerminateRound(&Float:delay=%f, &CSRoundEndReason:reason=%d)", delay, reason);

    if (InWarmup)
        return Plugin_Continue;
        
    if (reason == CSRoundEnd_GameStart)
        return Plugin_Handled;
        
    return Plugin_Continue;
}
Here are the round reasons:

Code:
enum CSRoundEndReason
{
    CSRoundEnd_TargetBombed = 0,           /**< Target Successfully Bombed! */
    CSRoundEnd_VIPEscaped,                 /**< The VIP has escaped! */
    CSRoundEnd_VIPKilled,                  /**< VIP has been assassinated! */
    CSRoundEnd_TerroristsEscaped,          /**< The terrorists have escaped! */
    CSRoundEnd_CTStoppedEscape,            /**< The CTs have prevented most of the terrorists from escaping! */
    CSRoundEnd_TerroristsStopped,          /**< Escaping terrorists have all been neutralized! */
    CSRoundEnd_BombDefused,                /**< The bomb has been defused! */
    CSRoundEnd_CTWin,                      /**< Counter-Terrorists Win! */
    CSRoundEnd_TerroristWin,               /**< Terrorists Win! */
    CSRoundEnd_Draw,                       /**< Round Draw! */
    CSRoundEnd_HostagesRescued,            /**< All Hostages have been rescued! */
    CSRoundEnd_TargetSaved,                /**< Target has been saved! */
    CSRoundEnd_HostagesNotRescued,         /**< Hostages have not been rescued! */
    CSRoundEnd_TerroristsNotEscaped,       /**< Terrorists have not escaped! */
    CSRoundEnd_VIPNotEscaped,              /**< VIP has not escaped! */
    CSRoundEnd_GameStart,                  /**< Game Commencing! */
    
    // The below only exist on CS:GO
    CSRoundEnd_TerroristsSurrender,        /**< Terrorists Surrender */
    CSRoundEnd_CTSurrender,                /**< CTs Surrender */
};
__________________
Neuro Toxin is offline
infinite_
SourceMod Donor
Join Date: Mar 2015
Old 03-30-2015 , 03:35   Re: [CS:GO] Disable round restarts when player joins empty team.
Reply With Quote #6

Couldn't I just return Plugin_Handled in every case to block all round terminations? (until the current map is over of course).

Last edited by infinite_; 03-30-2015 at 03:38.
infinite_ is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 03-30-2015 , 03:38   Re: [CS:GO] Disable round restarts when player joins empty team.
Reply With Quote #7

Nope.

If you block CSRoundEnd_GameStart every time. Warmup will never end.

You also block events like CSRoundEnd_Draw from happening meaning the map will never end.
__________________

Last edited by Neuro Toxin; 03-30-2015 at 03:38.
Neuro Toxin is offline
infinite_
SourceMod Donor
Join Date: Mar 2015
Old 03-30-2015 , 03:39   Re: [CS:GO] Disable round restarts when player joins empty team.
Reply With Quote #8

Are you referring to the warmup period that doesn't exist when mp_do_warmup_period is 0 or the warmup period when the server is waiting for both teams to have players?
infinite_ is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 03-30-2015 , 03:47   Re: [CS:GO] Disable round restarts when player joins empty team.
Reply With Quote #9

I personally run a warmup period on all my servers. You will have to trial and error until you've got it right.

What I know 100%.

1. 'mp_ignore_round_win_conditions 1' refers to this event CSRoundEnd_Draw and you cant block it or the map will NEVER change.

2. CSRoundEnd_GameStart is the event that fires when the match restarts based the conditions in the OP.
__________________
Neuro Toxin is offline
infinite_
SourceMod Donor
Join Date: Mar 2015
Old 03-30-2015 , 03:55   Re: [CS:GO] Disable round restarts when player joins empty team.
Reply With Quote #10

Quote:
Originally Posted by Neuro Toxin View Post
I personally run a warmup period on all my servers. You will have to trial and error until you've got it right.

What I know 100%.

1. 'mp_ignore_round_win_conditions 1' refers to this event CSRoundEnd_Draw and you cant block it or the map will NEVER change.

2. CSRoundEnd_GameStart is the event that fires when the match restarts based the conditions in the OP.
I see, thanks for all the help I think I can work something out
infinite_ 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 14:17.


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