Raised This Month: $ Target: $400
 0% 

[CSGO] Panorama Map Crash Fix (v1.4.0 30/03/2019)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
B3none
AlliedModders Donor
Join Date: Oct 2016
Location: United Kingdom
Old 03-28-2019 , 10:47   Re: [CSGO] Map Crash Fix All (v1 28/03/2019)
Reply With Quote #2

PHP Code:
#include <sourcemod>
#include <sdktools>

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

public Plugin myinfo =
{
    
name "Map Crash Fix",
    
author "Kashinoda",
    
description "Prevent client crashes on map change",
    
version "1.0.0",
    
url "http://alliedmods.net/"
};

public 
void OnPluginStart()
{
    
HookEvent("server_spawn"EventNewMap);
}
 
public 
void EventNewMap(Event event, const char[] namebool dontBroadcast)
{
    
CreateTimer(2.0RetryPlayers);    
    
LogMessage("Map change, reconnecting players in 2 seconds...");
}

public 
Action RetryPlayers(Handle timer)
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientConnected(i))
        {
            
ClientCommand(i"retry");
            
LogMessage("Sending retry to %N"i);
        }
    }

Hey, the URL wasn't quite right. May as well also set the version to 1.0.0 so that people know the first major version.

https://semver.org/

Edit:

I guess if you wanna be super tedious you could only hook the event for CS:GO.
PHP Code:
#include <sourcemod>
#include <sdktools>

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

public Plugin myinfo =
{
    
name "[CSGO] Panorama Map Crash Fix",
    
author "Kashinoda",
    
description "Prevent client crashes on map change",
    
version "1.1.0",
    
url "http://alliedmods.net/"
};

public 
void OnPluginStart()
{
    if (
GetEngineVersion() == Engine_CSGO)
    {
        
HookEvent("server_spawn"EventNewMap);
    }
    else
    {
        
LogError("This plugin is degisned to fix a bug for CS:GO");
    }
}
 
public 
void EventNewMap(Event event, const char[] namebool dontBroadcast)
{
    
CreateTimer(2.0RetryPlayers);    
    
LogMessage("Map change, reconnecting players in 2 seconds...");
}

public 
Action RetryPlayers(Handle timer)
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientConnected(i))
        {
            
ClientCommand(i"retry");
            
LogMessage("Sending retry to %N"i);
        }
    }

__________________

Last edited by B3none; 03-28-2019 at 10:55.
B3none is offline
 



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 08:40.


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