Raised This Month: $209 Target: $400
 52% 

[HOWTO] Make a NPC with extra features.


Post New Thread Reply   
 
Thread Tools Display Modes
pacheco
Senior Member
Join Date: Jul 2011
Old 11-04-2012 , 10:58   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #61

How can i get the name of who killed the NPC?
__________________




Last edited by pacheco; 11-04-2012 at 11:00.
pacheco is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 11-05-2012 , 13:43   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #62

PHP Code:
RegisterHamHam_Killed, ..., "NpcKilled_Post"true );

// ...

public NpcKilled_Postnpckillershouldgib )
{
    if( 
<= killer <= g_iMaxPlayers )
    {
        
// get name ..
    
}

__________________
micapat is offline
Good Hash
Junior Member
Join Date: Jul 2011
Old 11-24-2012 , 16:27   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #63

Quote:
Originally Posted by striker07 View Post
How can i give each npc a diffrent name; for example the name would be the entity clasname but with a number after it standing for the index of the entity.
so: entity_set_?(iEnt, ? , "%s[%s]", g_NpcClassName, ? ) ?

I want to use this to make a working deathmessage when somebody kills a npc

PHP Code:
// in npc_Killed(iEnt) {
new iVictim read_data(2)
 new 
iKiller read_data(1)
 new 
iHS read_data(3)
 new 
szWeapon[24]
 
read_data(4szWeapon23)
 
 
create_death_msg(iKilleriVictimiHSszWeapon);
}
 
stock create_death_msg(id,victim,headshot,weapon_name[])
{
 
message_begin(MSG_ALL,g_msg_death_msg,{0,0,0},0);
 
write_byte(id);
 
write_byte(victim);
 
write_byte(headshot);
 
write_string(weapon_name);
 
message_end();

but this gives me just my name killing with an unknown weapon nobody (nothing shows up for victim)
I've only one idea: To create BOT on game start, give him name. When some1 kills npc, send death message with BOT changename.
You see?
Good Hash is offline
Martz456
Junior Member
Join Date: Jan 2010
Old 12-18-2012 , 08:37   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #64

It would be cool if it's possible to make a NPC jump longjumps
Martz456 is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 05-23-2013 , 15:15   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #65

Can you update your tutorial and add something like npc find the nearest player and attack him?
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
MegasToRM
Member
Join Date: May 2012
Location: Serbia
Old 05-23-2013 , 16:04   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #66

Quote:
Originally Posted by ~Ice*shOt View Post
Can you update your tutorial and add something like npc find the nearest player and attack him?
Just in npc think add it ability to find "player" entity and to find closest to it.
MegasToRM is offline
Send a message via MSN to MegasToRM Send a message via Skype™ to MegasToRM
killer999
Senior Member
Join Date: Dec 2013
Location: India
Old 01-31-2014 , 01:05   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #67

i just installed you plugin
it works fine
but it wont attack me or move
:-(
Any reason??
__________________
killer999 is offline
Send a message via Skype™ to killer999
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 04-13-2014 , 04:47   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #68

I have one suggestion, could you or someone else add a function to give name for each NPC?
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 04-13-2014 , 19:11   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #69

Quote:
Originally Posted by ~Ice*shOt View Post
I have one suggestion, could you or someone else add a function to give name for each NPC?
Use pev_netname
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
smoka
Member
Join Date: Aug 2010
Old 04-07-2015 , 12:35   Re: [HOWTO] Make a NPC with extra features.
Reply With Quote #70

I know this thread is dead for quite some time, however can someone update it to work like this: in config file you set the coordinates where NPC's can be spawn however there should be an cvar to add more NPCs manually, and 1 final function to focus on a certain team however this is a long shot so if anyone willing to do this let me know PM or post inhere
smoka is offline
Reply


Thread Tools
Display Modes

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 07:57.


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