This site is a testing version, but all data is shared with the live forum.


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

Hook think\spawn "gib"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fl0werD
Senior Member
Join Date: May 2011
Old 08-10-2014 , 22:06   Hook think\spawn "gib"
Reply With Quote #1

How to hook think\spawn gibs after death in cs?
fl0werD is offline
Send a message via ICQ to fl0werD
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 08-11-2014 , 03:48   Re: Hook think\spawn "gib"
Reply With Quote #2

Last time I tested Ham_Think failed there, so I used register_think and it worked.
__________________


Last edited by NiHiLaNTh; 08-11-2014 at 03:48.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
fl0werD
Senior Member
Join Date: May 2011
Old 08-11-2014 , 06:48   Re: Hook think\spawn "gib"
Reply With Quote #3

In combat.cpp not used LINK_ENTITY_TO_CLASS( entity_class, CGib ); therefore cannot be registered through Ham
fl0werD is offline
Send a message via ICQ to fl0werD
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 08-11-2014 , 15:32   Re: Hook think\spawn "gib"
Reply With Quote #4

By looking at CS mod code, yeah, you're right; there is no associated classname to the CGib class. An easy way to hook Gib spawn would be hooking SetModel (checking the properly model)

Then with the gib entid, you can hook with RegisterHamFromEntity forwards you want. But at the first hook, you wouldn't be able to hook Spawn pre (because you'll be registering forwards just some steps after Spawn Pre).
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
fl0werD
Senior Member
Join Date: May 2011
Old 08-11-2014 , 21:03   Re: Hook think\spawn "gib"
Reply With Quote #5

Torment question: which is faster equal( szClassName, "gib" ) or ( szClassName[ 0 ] == 'g' && szClassName[ 2 ] == 'b' ) ?

Last edited by fl0werD; 08-11-2014 at 21:03.
fl0werD is offline
Send a message via ICQ to fl0werD
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 08-12-2014 , 10:21   Re: Hook think\spawn "gib"
Reply With Quote #6

The second one.
mottzi is offline
Send a message via MSN to mottzi
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 08-12-2014 , 23:10   Re: Hook think\spawn "gib"
Reply With Quote #7

Are you checking it's classname?
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
fl0werD
Senior Member
Join Date: May 2011
Old 08-13-2014 , 10:44   Re: Hook think\spawn "gib"
Reply With Quote #8

Quote:
Originally Posted by mottzi View Post
The second one.
Thanks.

Quote:
Originally Posted by meTaLiCroSS View Post
Are you checking it's classname?
Yes. You can suggest something better?
fl0werD is offline
Send a message via ICQ to fl0werD
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 08-13-2014 , 20:39   Re: Hook think\spawn "gib"
Reply With Quote #9

Quote:
Originally Posted by fl0werD View Post
Thanks.


Yes. You can suggest something better?
They have no classname lol, there's no linked classname to the CGib class, have you read my post?
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
fl0werD
Senior Member
Join Date: May 2011
Old 08-13-2014 , 20:51   Re: Hook think\spawn "gib"
Reply With Quote #10

Quote:
Originally Posted by meTaLiCroSS View Post
They have no classname lol, there's no linked classname to the CGib class, have you read my post?
He has no entity_class, but has a classname.
fl0werD is offline
Send a message via ICQ to fl0werD
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 02:58.


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