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

Hook entity creation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bibu
Veteran Member
Join Date: Sep 2010
Old 06-23-2017 , 17:24   Hook entity creation
Reply With Quote #1

I'd like to hook this function and block the entity from being created at all.

Quote:
CFuncWall::__MAKE_VHOOK
So far I tried Ham_Spawn, FM_SetModel, FM_CreateNamedEntity, FM_CreateEntity, fwd_keyvalue (fakemeta and engine forward).

I wouldn't have any problems to use any custom module for this if needed.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-23-2017 , 20:46   Re: Hook entity creation
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?p=2450393
eyal282 is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 06-23-2017 , 21:06   Re: Hook entity creation
Reply With Quote #3

untested

PHP Code:
new g_iFakeMetaSpawn;

public 
plugin_precache()
{
    
g_iFakeMetaSpawn register_forward(FM_Spawn"FakeMeta_Spawn_Post"1);
}

public 
FakeMeta_Spawn_Post(iEntity)
{
    if(!
pev_valid(iEntity)) return;
    new 
szClassName[32];
    
pev(iEntitypev_classnameszClassNamecharsmax(szClassName));
    if(
equal("func_wall"szClassName))
    {
        
engfunc(EngFunc_RemoveEntityiEntity);
    }
}

public 
plugin_init()
{
    
unregister_forward(FM_Spawng_iFakeMetaSpawntrue);

__________________
JusTGo is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 06-24-2017 , 04:06   Re: Hook entity creation
Reply With Quote #4

@eyal:

Well it's not an entity by amxx plugin, it's coming from a map.

@justgo:

Please re-read, I want it to have not spawned at all. So at this point, it's already late.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 06-24-2017 , 05:18   Re: Hook entity creation
Reply With Quote #5

Why do you need this? What is the purpose?
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-24-2017 , 07:40   Re: Hook entity creation
Reply With Quote #6

Quote:
Originally Posted by bibu View Post
@eyal:

Well it's not an entity by amxx plugin, it's coming from a map.

@justgo:

Please re-read, I want it to have not spawned at all. So at this point, it's already late.
You do know that changing 1 to 0 hooks the moment before the creation, while keeping as 1 hooks the moment after the creation, right?
eyal282 is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 06-24-2017 , 16:28   Re: Hook entity creation
Reply With Quote #7

Quote:
Originally Posted by PRoSToTeM@ View Post
Why do you need this? What is the purpose?
I'm trying to get rid off entities, in order to avoid the precache limit.
Since such brush entities do count to the models limit aswell, I don't want them to be created at all.
And I'm not gonna use ReHlds for this. But I consider using any module.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 06-24-2017 , 17:45   Re: Hook entity creation
Reply With Quote #8

Are you sure thats the name of the function ,can you please provide the function reference from regamedll.

Because i think okapi is the best option
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 06-25-2017 , 02:07   Re: Hook entity creation
Reply With Quote #9

https://github.com/dreamstalker/rehl...pp#L6157-L6161
All map brush models are directly precached by the engine.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
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 00:21.


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