Raised This Month: $ Target: $400
 0% 

RegisterHam for ALL Entities? [Solved]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 11-22-2007 , 17:47   RegisterHam for ALL Entities? [Solved]
Reply With Quote #1

I am trying to log a hamsandwich function, but not just for one specific entity...for ALL entities. Just like I would do for a fakemeta forward, FM_ForwardName.

I have tried using "*" for the entity parameter, but it doesn't seem to work

Code:
// This works fine RegisterHam( Ham_TakeDamage, "player", "hook_TakeDamage" ); // This doesn't RegisterHam( Ham_TakeDamage, "*", "hook_TakeDamage" );

The first of the two will carry on to my function and echo the TakeDamage event. The second of the two does not. I only used TakeDamage as an example because I knew it would work normally.

Is there a way to bypass the entity parameter and do it for all entities?
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician

Last edited by Wilson [29th ID]; 11-25-2007 at 10:13.
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 11-25-2007 , 10:12   Re: RegisterHam for ALL Entities?
Reply With Quote #2

According to the author of the hamsandwich bible via IRC,

Quote:
<sawce> you can't use * for an entity name
<sawce> you have to use a valid entity
<Zenith77`> Wilson29thID, you could just loop through every entity in game and register each one for the hook in a for loop.
<Zenith77`> This is a horrid method though.
<sawce> there's no other way to do it, i didn't add that because then there'd be requests to do it for every mod. it's best left for the plugin developers to have to slave over
<sawce> well
<sawce> not every entity in game
<sawce> but create a list of the entity names
<sawce> and loop through that
(Posted for anyone else who will want to know)
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 11-26-2007 , 04:13   Re: RegisterHam for ALL Entities? [Solved]
Reply With Quote #3

I figured it might be that.

Thanks for putting it up, btw.
purple_pixie is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 11-27-2007 , 11:29   Re: RegisterHam for ALL Entities? [Solved]
Reply With Quote #4

FYI: you could just read HS module thread for such info. Page 3[±1].
VEN 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 01:19.


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