Raised This Month: $2 Target: $400
 0% 

DHooks (Dynamic Hooks - Dev Preview)


Post New Thread Reply   
 
Thread Tools Display Modes
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 12-04-2019 , 05:51   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #731

Did you download the right version for SM 1.10 of the detours fork? You might have to stop the server before being able to replace the extension binaries, since they might be in use by the game server. This is a general problem with installing extensions though, there are plenty of posts covering that on this forum.
__________________
Peace-Maker is offline
Naleksuh
Member
Join Date: Dec 2018
Old 12-04-2019 , 14:45   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #732

Yep. Even though the file transfer was sucessful, stopping the server did it. Thanks man
Naleksuh is offline
Crasher_3637
AlliedModders Donor
Join Date: May 2012
Old 12-16-2019 , 08:19   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #733

Has anyone compiled an SM 1.11 version of the detours fork yet?
__________________
AFK like JFK
Crasher_3637 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 12-16-2019 , 09:30   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #734

Quote:
Originally Posted by Crasher_3637 View Post
Has anyone compiled an SM 1.11 version of the detours fork yet?
You shouldn't need one, the 1.10+ version should be fine on 1.11.
__________________
asherkin is offline
Crasher_3637
AlliedModders Donor
Join Date: May 2012
Old 12-16-2019 , 17:11   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #735

Quote:
Originally Posted by asherkin View Post
You shouldn't need one, the 1.10+ version should be fine on 1.11.
Yes, you're right. I did a full re-installation and DHooks started working.
__________________
AFK like JFK
Crasher_3637 is offline
Vit_amin
Senior Member
Join Date: Dec 2015
Location: Russian Federation
Old 12-20-2019 , 17:51   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #736

Gamedata
Code:
Games
{
	left4dead2
	{
        Signatures
        {
            PrecacheScriptSound
            {
                library "server"
		linux "@_ZN11CBaseEntity19PrecacheScriptSoundEPKc"
            }
        }
		Functions
		{
			PrecacheScriptSound
			{
				signature "PrecacheScriptSound"
				callconv "thiscall"
				return "int"
				this "ignore"
				arguments
				{
					szScriptEntry
					{
						type "charptr"
					}
				}
			}
		}
	}
}
Plugin:
PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <dhooks>
#include <sdktools>

public void OnPluginStart()
{
    
GameData hGameData = new GameData("l4d2_precache_dhooks");
    if (
hGameData == null)
    {
        
delete hGameData;
        
SetFailState("Failed to load \"l4d2_precache_dhooks.txt\" gamedata");
    }
    
    
Handle hPrecacheScript DHookCreateFromConf(hGameData"PrecacheScriptSound");
    if (
hPrecacheScript == null)
    {
        
delete hGameData;
        
SetFailState("Error finding the 'PrecacheScriptSound' function.");
    }
    
    
DHookEnableDetour(hPrecacheScripttrueDHookCallback_PrecacheScriptSound);
    
    
delete hGameData;
}

public 
MRESReturn DHookCallback_PrecacheScriptSound(Handle hReturnHandle hParams)
{
    
char szScriptEntry[32];
    
DHookGetParamString(hParams1szScriptEntrysizeof(szScriptEntry));
    
    
PrintToServer("=== PrecacheScriptSound %s"szScriptEntry);
    
    if (
strcmp(szScriptEntry"Flies.Swarm"false) == 0)
    {
        return 
MRES_Supercede;
    }
    
    return 
MRES_Ignored;

Crash Reason

Last edited by Vit_amin; 12-21-2019 at 16:01.
Vit_amin is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 12-21-2019 , 15:14   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #737

What are you trying to do? Or what's your question? You're returning MRES_Override in a post-hook without setting the new return value first. You probably want a pre-hook and supercede? That might fix the crash too if the parameter was changed during execution.
__________________
Peace-Maker is offline
Vit_amin
Senior Member
Join Date: Dec 2015
Location: Russian Federation
Old 12-21-2019 , 16:00   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #738

Quote:
Originally Posted by Peace-Maker View Post
What are you trying to do? Or what's your question? You're returning MRES_Override in a post-hook without setting the new return value first. You probably want a pre-hook and supercede? That might fix the crash too if the parameter was changed during execution.
Sorry, I mistake in MRES_Overeide need replaced to MRES_Supercede
I want block precached some sound script entries
Vit_amin is offline
Et3rnity
Junior Member
Join Date: Sep 2018
Old 12-22-2019 , 10:39   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #739

[SM] Unable to load extension "dhooks.ext": /lib/libc.so.6: version `GLIBC_2.16' not found (required by /home/csa_82/89.40.104.71-27015/csgo/addons/sourcemod/extensions/dhooks.ext.so)
Et3rnity is offline
bebe9b
Veteran Member
Join Date: May 2009
Location: Romania
Old 12-22-2019 , 14:14   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #740

"alwaysweaponskins.smx": Required extension "dhooks" file
__________________
respecta si vei fi respectat
bebe9b is offline
Reply


Thread Tools
Display Modes

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 04:43.


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