View Single Post
root88
Senior Member
Join Date: May 2016
Old 11-08-2016 , 06:06   Re: [CS:GO] Blank map in server browser with GOTV+hibernation
Reply With Quote #7

This can be done with a plugin:

PHP Code:
#include <sourcemod>
#pragma semicolon 1

new String:mapname[64];
new 
MapIsReloading;

public 
Plugin:myinfo =
{
    
name "Punting bot fix",
    
author "root",
    
description "Fixes some s*it",
    
version "1.0.1",
    
url "http://uwujka.pl"
}
public 
OnMapStart()
{
    
HookEvent("player_disconnect"PlayerDisconnected,EventHookMode_Post);
    
GetCurrentMap(mapnamesizeof(mapname));
    
MapIsReloading 0;
}

public 
Action:PlayerDisconnected(Handle:event, const String:name[], bool:dontBroadcast)
{
    
decl String:s_reason[256];
    
GetEventString(event,"reason"s_reasonsizeof(s_reason));
    if(
StrContains(s_reason"Punting bot"false) != -1)
    {
        if(
GetClientCount() < && MapIsReloading == 0)
        {
            
ForceChangeLevel(mapname,"Restarting map");
            
LogMessage("Restarting map");
            
MapIsReloading 1;
        }
    }
    return 
Plugin_Continue;

I'm using this on CSGO servers with GOTV, bots and hibernation disabled. Without this plugin, when last real player disconnected, server was hibernating, kicking bots which gives blank map name.
__________________

Last edited by root88; 11-08-2016 at 06:12.
root88 is online now