Raised This Month: $32 Target: $400
 8% 

Prehook CreateEntityByName


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 09-20-2015 , 05:04   Prehook CreateEntityByName
Reply With Quote #1

I need to prehook this function and override it, but I can't find a way to do it.
IServerTools has this function, but how can I hook it?

I've got a strange behavior with the most recent sdk
This hook only works under linux:
Quote:
SH_ADD_HOOK_MEMFUNC(IVEngineServer, RemoveEdict, engine, &g_interface, &Extension::RemoveEdict, false);
I've checked this extension: https://forums.alliedmods.net/showthread.php?t=186830
CreateEdict/RemoveEdict don't' work under windows either

This hook only works when I call this function: servertools->CreateEntityByName("prop_dynamic");
Quote:
SH_ADD_HOOK_MEMFUNC(IServerTools, CreateEntityByName, servertools, &g_interface, &Extension::CreateEntityByName, false);
But it doesn't work with server entities and GiveNamedItem

Last edited by kadet.89; 09-20-2015 at 06:44.
kadet.89 is offline
Send a message via Skype™ to kadet.89
psychonic

BAFFLED
Join Date: May 2008
Old 09-20-2015 , 09:00   Re: Prehook CreateEntityByName
Reply With Quote #2

Quote:
Originally Posted by kadet.89 View Post
I need to prehook this function and override it, but I can't find a way to do it.
IServerTools has this function, but how can I hook it?

I've got a strange behavior with the most recent sdk
This hook only works under linux:
You're probably hooking the old v21 version of the interface, rather than VEngineServer023. The old one isn't called and is just a shim.

Quote:
Originally Posted by kadet.89 View Post
I've checked this extension: https://forums.alliedmods.net/showthread.php?t=186830
CreateEdict/RemoveEdict don't' work under windows either

This hook only works when I call this function: servertools->CreateEntityByName("prop_dynamic");

But it doesn't work with server entities and GiveNamedItem
IServerTools:CreateEntityByName only exposes the internal CreateEntityByName function for external consumers (such as plugins) to call. You would need to get at the internal one directly.
psychonic is offline
Reply



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 21:02.


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