View Single Post
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 06-21-2015 , 16:21   Re: Players banned for dying?
Reply With Quote #11

I made a plugin to block this, it however requires dhooks. As far as I can tell mp_autokick works, however this disables other kicks which I feel are important (afk kicker, tk/ta kicker and a few others iirc). The plugin simply stops punishing suicides.

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

Handle hSuicidePenalty;

public 
void OnPluginStart()
{
    
Handle temp LoadGameConfigFile("suicide.games");
    
    if(
temp == INVALID_HANDLE)
    {
        
SetFailState("Failed to locate suicide.games.txt");
    }
    
    
int offset;
    
    
offset GameConfGetOffset(temp"UseSuicidePenalty");
    
hSuicidePenalty DHookCreate(offsetHookType_GameRulesReturnType_BoolThisPointer_IgnoreUseSuicidePenalty);
    
    
CloseHandle(temp);
}

public 
OnMapStart()
{
    
//Hook Gamerules function in map start
    
DHookGamerules(hSuicidePenaltytrue);
}

public 
MRESReturn UseSuicidePenalty(Handle hReturn)
{
    
DHookSetReturn(hReturnfalse);
    return 
MRES_Override;

Gamedata: suicide.games.txt

Code:
"Games"
{
	"csgo"
	{
		"Offsets"
		{
			"UseSuicidePenalty"
			{
				"windows"	"149"
				"linux"		"150"
			}
		}
	}
}

Last edited by Dr!fter; 06-21-2015 at 16:22.
Dr!fter is offline