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

cs go server not changing maps when empty


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mayersdz
Member
Join Date: Jun 2015
Old 07-10-2022 , 09:54   cs go server not changing maps when empty
Reply With Quote #1

ok here we go when i set a starting map for my server , it doesnt change the map at all when empty , it needs players connected before the timelimit thing start working and changing maps.

is there a way to set the server to change maps when empty ?
mayersdz is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 07-25-2022 , 12:56   Re: cs go server not changing maps when empty
Reply With Quote #2

...this could done by adding few bots to play all the time. (bot_join_after_player 0) and need change more cvars etc. etc.
*edit
and use sv_hibernate_when_empty 0



I don't know how you manage map cycle and votes...

But try this.
in ...cfg/sourcemod/sourcemod.cfg add in first line
Code:
sm_nextmap " " // This stop loop same map
And here one kind script
PHP Code:
#include <sdktools>

ConVar mp_timelimit;
Handle my_timer;

public 
void OnPluginStart()
{
    
HookEvent("switch_team"switch_team); // This event is executed by human players only
    
mp_timelimit FindConVar("mp_timelimit");
}

public 
void switch_team(Event event, const char[] namebool dontBroadcast)
{
    
//PrintToServer("switch_team");
//
//- "numPlayers" = "0"
//- "numSpectators" = "0"
//
    
if(event.GetInt("numPlayers") == && event.GetInt("numSpectators") == 0)
    {
        
//PrintToServer("switch_team create timer");
        
CreateTimerGameEnd();
    }
    else
    {
        if(
my_timer != null)
            
delete my_timer;
    }
}


public 
void OnConfigsExecuted()
{
    
//PrintToServer("OnConfigsExecuted");
    // Make timer when map start
    
my_timer null;
    
CreateTimerGameEnd();
}

public 
void CreateTimerGameEnd()
{
    if(
my_timer != null)
        
delete my_timer;

    
float seconds 120.0// Default 2 minutes

    
if(mp_timelimit != null)
    {
        
float timelimit mp_timelimit.FloatValue;
        
        if(
timelimit >= 1.0 && timelimit <= 60.0// If mp_timelimit is in range of one minute and 60 minutes, update timer to that
        
{
            
seconds timelimit 60.0;
        }
    }

    
CreateTimer(secondsdelay_TIMER_FLAG_NO_MAPCHANGE);

}

public 
Action delay(Handle timer)
{
    
my_timer null;
    
//PrintToServer("Timer delay executed");

    
int entity FindEntityByClassname(-1"game_end");

    if(
entity == -1)
    {
        
entity CreateEntityByName("game_end");
    }

    if(
entity != -1)
    {
        
PrintToServer("EndGame");
        
AcceptEntityInput(entity"EndGame");
    }

    return 
Plugin_Continue;

- Timer stop when player enter in team T or CT or spectator.
- Plugin look only human player count.
- Default is 2 minutes, unless you have set up mp_timelimit between 1 - 60 minutes, timer will use that.
__________________
Do not Private Message @me

Last edited by Bacardi; 07-27-2022 at 06:44.
Bacardi 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 05:50.


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