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

[SOLVED] func_breakable how to know if it was used/broke?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 09-06-2015 , 18:14   [SOLVED] func_breakable how to know if it was used/broke?
Reply With Quote #1

So, in order to destroy an entity func_breakable, i did:
PHP Code:
new szClassname[14]
pev(iEntitypev_classnameszClassnamecharsmax(szClassname))
                
if(
equal(szClassname"func_breakable"))
    
dllfunc(DLLFunc_UseiEntity0
It works fine, but if i call the code again, it is used again. So, should i hook Ham_Use to check when it's used and block a second usage? Is there any better solution?
__________________
Jhob94 is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 09-07-2015 , 03:52   Re: func_breakable how to know if it was used/broke?
Reply With Quote #2

Check the health.
Code:
if( equal(szClassName, "func_breakable") && !(pev(pEntity, pev_spawnflags) & SF_BREAK_TRIGGER_ONLY) && pev(pEntity, pev_health) > 0 )
Rirre is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 09-07-2015 , 04:11   Re: func_breakable how to know if it was used/broke?
Reply With Quote #3

Checking the health is fine enough or should i check the spawnflags too?
__________________
Jhob94 is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 09-07-2015 , 04:26   Re: func_breakable how to know if it was used/broke?
Reply With Quote #4

if pev->solid is SOLID_NOT then it's broken
lazarev is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 09-07-2015 , 05:14   Re: func_breakable how to know if it was used/broke?
Reply With Quote #5

Quote:
Originally Posted by lazarev View Post
if pev->solid is SOLID_NOT then it's broken
Yeah lol, wtf, how didn't i thought about this?

Thanks
__________________
Jhob94 is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 09-07-2015 , 06:31   Re: func_breakable how to know if it was used/broke?
Reply With Quote #6

Quote:
Originally Posted by Jhob94 View Post
Checking the health is fine enough or should i check the spawnflags too?
If you want to blow up e.g. the boxes on de_dust2, then no.
Rirre 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 11:37.


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