Raised This Month: $51 Target: $400
 12% 

How can I compile this plugin? [SM PLUGINS BLOCK]


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
BombaciMulayim
Junior Member
Join Date: Jan 2017
Old 03-14-2017 , 16:57   How can I compile this plugin? [SM PLUGINS BLOCK]
#1

How can I compile this plugin? [SM PLUGINS BLOCK]

+Actual dhooks
+Actual spedit

HTML Code:
#include <sourcemod>
#include <dhooks>
#include <sdktools>

new Handle:hClientPrintf = INVALID_HANDLE;

public OnPluginStart()
{    
    new Handle:gameconf = LoadGameConfigFile("clientprintf-hook.games");
    if(gameconf == INVALID_HANDLE)
    {
        SetFailState("Failed to find clientprintf-hook.games.txt gamedata");
    }
    new offset = GameConfGetOffset(gameconf, "ClientPrintf");
    if(offset == -1)
    {
        SetFailState("Failed to find offset for ClientPrintf");
        CloseHandle(gameconf);
    }
    StartPrepSDKCall(SDKCall_Static);
    if(!PrepSDKCall_SetFromConf(gameconf, SDKConf_Signature, "CreateInterface"))
    {
        SetFailState("Failed to get CreateInterface");
        CloseHandle(gameconf);
    }
    
    PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer);
    PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Pointer, VDECODE_FLAG_ALLOWNULL);
    PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain);
    
    new String:interface[64];
    if(!GameConfGetKeyValue(gameconf, "EngineInterface", interface, sizeof(interface)))
    {
        SetFailState("Failed to get engine interface name");
        CloseHandle(gameconf);
    }
    
    new Handle:temp = EndPrepSDKCall();
    new Address:addr = SDKCall(temp, interface, 0);
    
    CloseHandle(gameconf);
    CloseHandle(temp);
    
    if(!addr) SetFailState("Failed to get engine ptr");
    
    hClientPrintf = DHookCreate(offset, HookType_Raw, ReturnType_Void, ThisPointer_Ignore, Hook_ClientPrintf);
    DHookAddParam(hClientPrintf, HookParamType_Edict);
    DHookAddParam(hClientPrintf, HookParamType_CharPtr);
    DHookRaw(hClientPrintf, false, addr);
}
public MRESReturn:Hook_ClientPrintf(Handle:hParams)
{
	decl String:buffer[1024];
	DHookGetParamString(hParams, 2, buffer, 1024);
	if(buffer[1] == '"' && (StrContains(buffer, "\" (") != -1 || (StrContains(buffer, ".smx\" ") != -1))) 
	{
		DHookSetParamString(hParams, 2, "");
		return MRES_ChangedHandled;
	}
	else if(StrContains(buffer, "To see more, type \"sm plugins") != -1)
	{
		DHookSetParamString(hParams, 2, "Sm Plugins Block Active");
		return MRES_ChangedHandled;
	}
	return MRES_Ignored;
}
BombaciMulayim is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 03-14-2017 , 17:12   Re: How can I compile this plugin? [SM PLUGINS BLOCK]
#2

Blocking "sm plugins" is not supported here, to the best of my knowledge.
__________________
ddhoward is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 03-14-2017 , 19:51   Re: How can I compile this plugin? [SM PLUGINS BLOCK]
#3

Apart from that, it is an obnoxious behavior to use such a plugin.
__________________
coding & free software
shanapu is offline
headline
SourceMod Moderator
Join Date: Mar 2015
Old 03-14-2017 , 20:08   Re: How can I compile this plugin? [SM PLUGINS BLOCK]
#4

Not going to get help for this here.

Last edited by headline; 03-14-2017 at 20:09.
headline is offline
Closed Thread



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 20:09.


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