RSSy MYGO.pl Opublikowano Marzec 28, 2019 o 13:25 RSSy Udostępnij Opublikowano Marzec 28, 2019 o 13:25 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/ CodeThis 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 mapcrashfixall.smx (4.3 KB) Get Plugin or Get Source (mapcrashfixall.sp - 976 Bytes) Wyświetl pełny artykuł Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi
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ę