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

How To: Make a perfect NPC


Post New Thread Reply   
 
Thread Tools Display Modes
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 09-06-2008 , 14:31   Re: How To: Make a perfect NPC
Reply With Quote #101

Quote:
Originally Posted by xPaw View Post
okay other question, why npc_think working but not like i need

i'm touching npc, and it sayd not mine id, it says like 50 or 90
Post your code. ;)
[X]-RayCat is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-06-2008 , 14:53   Re: How To: Make a perfect NPC
Reply With Quote #102

PHP Code:
#include <amxmodx>
#include <engine>

public plugin_init()
{
    
register_plugin("NPC""0.0""")
    
register_clcmd("say .npc""npc")
    
register_think("npc_lol","npc_think")
}

public 
plugin_precache()
{
    
precache_model("models/player/vip/vip.mdl")
    
precache_model("models/p_c4.mdl")
}

public 
npc(id)
{
    new 
Float:origin[3]
    
entity_get_vector(id,EV_VEC_origin,origin)
    new 
ent create_entity("info_target")
    
give_weapon(ent)
    
entity_set_origin(ent,origin);
    
origin[2] += 300.0
    entity_set_origin
(id,origin)
    
entity_set_float(ent,EV_FL_takedamage,1.0)
    
entity_set_float(ent,EV_FL_health,100.0)
    
entity_set_string(ent,EV_SZ_classname,"npc_lol");
    
entity_set_model(ent,"models/player/vip/vip.mdl");
    
entity_set_int(ent,EV_INT_solid2)
    
entity_set_byte(ent,EV_BYTE_controller1,125);
    
entity_set_byte(ent,EV_BYTE_controller2,125);
    
entity_set_byte(ent,EV_BYTE_controller3,125);
    
entity_set_byte(ent,EV_BYTE_controller4,125);
    new 
Float:maxs[3] = {16.0,16.0,36.0}
    new 
Float:mins[3] = {-16.0,-16.0,-36.0}
    
entity_set_size(ent,mins,maxs)
    
entity_set_float(ent,EV_FL_animtime,2.0)
    
entity_set_float(ent,EV_FL_framerate,1.0)
    
entity_set_int(ent,EV_INT_sequence,54);   // The number of the sequence that shall be played.
    
entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.01)
    
drop_to_floor(ent)
    return 
1;
}

public 
give_weapon(ent)
{
    new 
entWeapon create_entity("info_target")
    
entity_set_string(entWeaponEV_SZ_classname"npc_weapon")
    
entity_set_int(entWeaponEV_INT_movetypeMOVETYPE_FOLLOW)
    
entity_set_int(entWeaponEV_INT_solidSOLID_NOT)
    
entity_set_edict(entWeaponEV_ENT_aimentent)
    
entity_set_model(entWeapon"models/p_c4.mdl"
}

public 
npc_think(id)
{
    
client_print(0print_chat"ID: %d Touched NPC!"id)
    
entity_set_float(id,EV_FL_nextthink,halflife_time() + 0.01)

__________________
xPaw is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-06-2008 , 15:21   Re: How To: Make a perfect NPC
Reply With Quote #103

That is the index of ent that is thinking.
Alka is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-07-2008 , 03:34   Re: How To: Make a perfect NPC
Reply With Quote #104

and how to fix it?
__________________
xPaw is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-07-2008 , 03:57   Re: How To: Make a perfect NPC
Reply With Quote #105

Fix what? What are you trying to do?...
Alka is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-07-2008 , 06:59   Re: How To: Make a perfect NPC
Reply With Quote #106

i want, when player touching npc, it opens menu for this player, like in pokemod
__________________
xPaw is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 09-07-2008 , 17:04   Re: How To: Make a perfect NPC
Reply With Quote #107

You need to log a touch event, like register_touch(), or whatever, and set the two entities that touches each other - you/any other player and the entity (the npc).
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-18-2008 , 18:45   Re: How To: Make a perfect NPC
Reply With Quote #108

Is it possible to make one of these invisible and be recognized as a T\CT?

Could possibly used in an aimbot detection tool. Make an invisible enemy and if the aimbotter shoots it, you caught an aimbot.
__________________
Bugsy is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 09-19-2008 , 06:30   Re: How To: Make a perfect NPC
Reply With Quote #109

Quote:
Originally Posted by Bugsy View Post
Is it possible to make one of these invisible and be recognized as a T\CT?

Could possibly used in an aimbot detection tool. Make an invisible enemy and if the aimbotter shoots it, you caught an aimbot.
set_entity_visibility( ent, 0 );
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 09-19-2008 at 08:19.
Dores is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 06-29-2009 , 04:20   Re: How To: Make a perfect NPC
Reply With Quote #110

why i don't see my NPC in my server ?

PHP Code:
#include <amxmodx>
#include <engine>

public plugin_init() 
{
        
register_clcmd("vip""spawn_npc")
        
register_plugin("NPC","1.0","Mr.Noobie")
        
register_think("npc_vip","npc_think")
}

public 
plugin_precache()
{
    
precache_model("models/vip.mdl")
    
precache_model("models/p_ak47.mdl")
}

public 
spawn_npc(id)
{
    new 
Float:origin[3]
    
entity_get_vector(id,EV_VEC_origin,origin)
    new 
ent create_entity("info_target")
    
give_weapon(ent)
    
entity_set_origin(ent,origin)
    
origin[2] += 300.0
    entity_set_origin
(id,origin)
    
entity_set_float(ent,EV_FL_takedamage,1.0)
    
entity_set_float(ent,EV_FL_health,100.0)
    
entity_set_string(ent,EV_SZ_classname,"npc_vip")
    
entity_set_model(ent,"models/vip.mdl")
    
entity_set_int(ent,EV_INT_solid2)
    
entity_set_byte(ent,EV_BYTE_controller1,125)
    
entity_set_byte(ent,EV_BYTE_controller2,125)
    
entity_set_byte(ent,EV_BYTE_controller3,125)
    
entity_set_byte(ent,EV_BYTE_controller4,125)
    new 
Float:maxs[3] = {16.0,16.0,36.0}
    new 
Float:mins[3] = {-16.0,-16.0,-36.0}
    
entity_set_size(ent,mins,maxs)
    
entity_set_float(ent,EV_FL_animtime,2.0)
    
entity_set_float(ent,EV_FL_framerate,1.0)
    
entity_set_int(ent,EV_INT_sequence,0)
    
entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.01)
    
drop_to_floor(ent)
    return 
1
}

public 
give_weapon(ent)
{
        new 
entWeapon create_entity("info_target")
        
entity_set_string(entWeaponEV_SZ_classname"npc_weapon")
        
entity_set_int(entWeaponEV_INT_movetypeMOVETYPE_FOLLOW)
        
entity_set_int(entWeaponEV_INT_solidSOLID_NOT)
        
entity_set_edict(entWeaponEV_ENT_aimentent)
        
entity_set_model(entWeapon"models/p_ak47.mdl"
}

public 
npc_think(id)
{
    
entity_set_float(id,EV_FL_nextthink,halflife_time() + 0.01)

Mr.Noobie 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 19:51.


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