[HELP] Hook Custom Entity Being Destroyed
So let's say I made a breakable entity, and set its classname to 'func_myent' for example. How do I detect if it gets destroyed? I wanted to put some gibs when it gets killed. But I haven't seen anyone do it, only with the classname 'func_breakble' but if I use that classname it would include every breakable entity on the map, not just my custom entity...
|
Re: [HELP] Hook Custom Entity Being Destroyed
Create your entity as func_breakable and use set_pev pev_classne with your classname(func_myent).
Hook TakeDamage with func_breakable. Inside take_damage retrieve pev_classname and check against func_myent. |
Re: [HELP] Hook Custom Entity Being Destroyed
Hook Ham_Killed with func_breakable check if victim ( 1st Param ) classname is equal to your entity classname .
|
Re: [HELP] Hook Custom Entity Being Destroyed
Quote:
PHP Code:
Also, regarding Natsheh's post and why you didn't suggest it, I suspect Ham_Killed only works on players?... |
Re: [HELP] Hook Custom Entity Being Destroyed
Quote:
Quote:
Ham_Killed doesn't work only on players, but it's not called for func_breakable. |
| All times are GMT -4. The time now is 14:09. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.