Raised This Month: $ Target: $400
 0% 

How To: Make a perfect NPC


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-29-2009 , 04:50   Re: How To: Make a perfect NPC
Reply With Quote #111

Is models/vip.mdl exist ?
__________________
Arkshine is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 06-29-2009 , 04:52   Re: How To: Make a perfect NPC
Reply With Quote #112

Yes

Here is the codes :

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/player/vip/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/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,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)


Last edited by Mr.Noobie; 06-29-2009 at 04:54.
Mr.Noobie is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-29-2009 , 04:56   Re: How To: Make a perfect NPC
Reply With Quote #113

It was not your previous code...
__________________
Arkshine is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 06-29-2009 , 04:59   Re: How To: Make a perfect NPC
Reply With Quote #114

Quote:
Originally Posted by arkshine View Post
It was not your previous code...
ya i update already but still can't i can't find my NPC
Mr.Noobie is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-29-2009 , 05:06   Re: How To: Make a perfect NPC
Reply With Quote #115

The code works fine, just tested right now.
__________________
Arkshine is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 06-29-2009 , 05:13   Re: How To: Make a perfect NPC
Reply With Quote #116

Quote:
Originally Posted by arkshine View Post
The code works fine, just tested right now.
But i don't see NPC

ok how do i spawn the NPC ?
Mr.Noobie is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-29-2009 , 05:29   Re: How To: Make a perfect NPC
Reply With Quote #117

Again, the code above WORKS fine. So start to see if the plugin is running.
__________________
Arkshine is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 06-29-2009 , 06:03   Re: How To: Make a perfect NPC
Reply With Quote #118

Quote:
Originally Posted by arkshine View Post
Again, the code above WORKS fine. So start to see if the plugin is running.
ok it work

must type vip in console also when i type vip i stuck in the sky

but how to make blood when the attacker hit the NPC or show the dead animation

Last edited by Mr.Noobie; 06-29-2009 at 06:05.
Mr.Noobie is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-29-2009 , 06:05   Re: How To: Make a perfect NPC
Reply With Quote #119

You have to use the client command 'vip' in the console.
__________________
Arkshine is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 06-30-2009 , 03:10   Re: How To: Make a perfect NPC
Reply With Quote #120

Quote:
Originally Posted by arkshine View Post
You have to use the client command 'vip' in the console.
Is there anyway i can add blood or anima when dead ??
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 13:18.


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