Raised This Month: $ Target: $400
 0% 

Touch - yes again


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.G
Senior Member
Join Date: Nov 2008
Old 01-28-2009 , 15:08   Re: Touch - yes again
Reply With Quote #1

So i need to register both entitys to the same forward?? Shiiit my brain is boiling....

ups that variable was a copy paste thing...

PHP Code:
RegisterHam(Ham_Touch"grenade""fwd_Ham_Touch"); 
RegisterHamFromEntity(Ham_Touch"nade_fix""fwd_Ham_Touch");
 
 
public 
fwd_Ham_Touch(ident); 

    
// ... 

__________________
Dr.G is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-28-2009 , 16:00   Re: Touch - yes again
Reply With Quote #2

No, only RegisterHam with "grenade" classname, or weapon_handgrenade or whatever is this entity classname.
If it's the same as cs, as soon as you have launched the nade, classname is "grenade" (in fact the launched nade is a new entity and the nade that you were holding doesn't exist anymore).

So, something like this :

PHP Code:
RegisterHam(Ham_Touch"grenade""Grenade_Touch")

public 
Grenade_TouchiNade iEnt )
{
    if( !
pev_validiEnt ) )
        return 
HAM_IGNORED
    
static szClassName[9]
    
pev(iEntpev_classnameszClassNamecharsmax(szClassName))
    if( !
equalszClassName"nade_fix") )
        return 
HAM_IGNORED
    engfunc
(Engfunc_RemoveEntityiNade)
    return 
HAM_SUPERCEDE

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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:53.


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