Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

[CSGO] Map Crash Fix All (v1 28/03/2019)


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
This is an alternative version of BOT Benson's plugin which was later modified by Agent Wesker.

Description
This fixes client crashes that have been happening since Valve introduced Panorama. This is achieved by forcing clients to reconnect on map change.

This does not look for hooks in Sourcemod plugins, it waits until CSGO's server_spawn event occurs then initiates a timer (2 seconds) before sending retry. The double loading map issue is eliminated because the retry commands are not sent until the map has actually changed.

From my testing it will work with any map change (sm_map, RTV, changelevel etc.) because the server_spawn event always occurs when loading a new map regardless of how it was called. With multiple clients connected to the server I have not been able to initiate a client crash in 100 or so map changes.

Installation
Place smx file in csgo/addons/sourcemod/plugins/

Code
This can definitely be optimised, I have absolutely no experience with Sourcemod. The timer IS required, the server_spawn event occurs within a second of a map change being initialised and it doesn't detect clients are still connected. It might be that you can reduce the timer if required.

Code:

#include <sourcemod>
#include <sdktools>

#pragma semicolon 1
#pragma tabsize 0
#pragma newdecls required

public Plugin myinfo =
{
    name        = "MapCrashFixAll",
    author      = "Kashinoda",
    description = "Prevents client crashes on map change",
    version    = "1.0 Test",
    url        = "https://www.alliedmods.com"
};

public void OnPluginStart()
{
        HookEvent("server_spawn", EventNewMap);
}
 
public void EventNewMap(Event event, const char[] name, bool dontBroadcast)
{

        CreateTimer(2.0, Timer_RetryPlayers);       
        LogMessage("Map change, reconnecting players in 2 seconds...");
}

public Action Timer_RetryPlayers( Handle timer , int _any )
{
        RetryClients(_any);
        return Plugin_Stop;
}

stock bool RetryClients(int forceChange)
{

        for( int i = 1; i <= MaxClients; i++ )
{
        if( IsClientConnected( i ) )
                        {
        ClientCommand( i, "retry" );
        LogMessage("Sending retry to %N", i);
       
                        }
}
        if (!forceChange)
                return;
}


Attached Files
File Type: smx mapcrashfixall.smx (4.3 KB)
File Type: sp Get Plugin or Get Source (mapcrashfixall.sp - 976 Bytes)

Wyświetl pełny artykuł

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...