View Single Post
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 12-20-2010 , 04:24   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #9

Quote:
Originally Posted by Exolent[jNr] View Post
Yes.
Quote:
Originally Posted by Mini_Midget View Post
@Arkshine
Thanks for that! Didn't realize that function works with floats.
Do you mean I should not use RegisterHamFromEntity() at all or just once?
Something like this?
PHP Code:
public plugin_init()
{
    
register_plugin("NPC Plugin""1.0""Mazza");
    
register_clcmd("say /npc""clcmd_npc");
    
    
RegisterHam(Ham_TakeDamage"info_target""npc_TakeDamage");
    
RegisterHam(Ham_Killed"info_target""npc_Killed");
    
RegisterHam(Ham_Think"info_target""npc_Think");
    
RegisterHam(Ham_TraceAttack"info_target""npc_TraceAttack");

Would I still need to filter out the classname for each of them inside the forwards?

@bibu
I'm quite sure there is a tutorial on how the touch forward works. That's why I didn't really bother with it. If there is much requests for this feature, I'll write it up.
As you said, giving a NPC a weapon is already in the other tutorial so I found no need to simply just copy and paste it in here.

@meTaLiCroSS
Mmm... I had problems last night with those pev values... But fixed now.
Silly me! Was working on this quite late last night and wasn't thinking straight.
Both ov you confused me

The class name of an entity is what we set through pev_classname, right ?
So in order for registering the ham_forwards we will use "npc_ent" as the classname ??

And if we use info_target as the class name then if we check the classname in the forward, it would return "info_target" instead of "npc_ent"

BTW what is the actuall class name of the NPC ?? is it "npc_ent" or "info_target" ??
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman