Raised This Month: $ Target: $400
 0% 

create_zombie


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
The Inhabitant Of Heavens
Member
Join Date: Aug 2011
Old 11-16-2011 , 12:50   create_zombie
Reply With Quote #1

my NPC always stuck in ground, how to fix that


PHP Code:
public create_zombie(Float:origin[3],Float:angle[3])
{

    new 
ent create_entity("info_target"); 
    
entity_set_string(entEV_SZ_classname"npc_zombie"); 
   
    
entity_set_origin(entorigin);  
    
entity_set_vector(entEV_VEC_anglesangle);
 
    
set_pev(ent,pev_takedamage,1.0
    
set_pev(ent,pev_dmg,1.0)
 
    
//Make our NPC recieve damage and give it some health 
    
entity_set_float(entEV_FL_takedamage1.0); 
    
entity_set_float(entEV_FL_health250.0+HEALTH_OFFSET);  
 
    
//Set the model for our NPC 
    
entity_set_model(ent"models/npc.mdl"); 
    
//Set our movetype and solid stuff for our NPC 
    
entity_set_int(entEV_INT_movetypeMOVETYPE_PUSHSTEP); 
    
entity_set_int(entEV_INT_solidSOLID_BBOX); 
        
    
Util_PlayAnimation(ent2)
         
    
//Set our NPC bounding size box respect to the models origin 
    
new Floatmins[3] = {-24.0, -24.00.0 
    new 
Floatmaxs[3] = { 24.024.075.0 
    
entity_set_size(entminsmaxs); 
     
    
//These four controllers are for the moveable bones for models. All vary differently. Numbers start at 0 to 255 
    //This controller for our model controls the head rotation. 0 means the head will turn far left while 255 means the head will turn far right 
    
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); 
    
 
     

     
    //Drop our NPC to the floor 
    
drop_to_floor(ent); 
    
entity_set_int(entEV_INT_modelindexmdl_zombie);
     
    
// set speed monster
    
npc_speed[ent]=130;
    
npc_state[ent]=0//spawning
    
npc_activenode[ent]=-1;
    
npc_node[ent][0]=-1;
    
npc_node[ent][1]=-1;
    
npc_node[ent][2]=-1;
 
                
// starting animation
    
set_task(2.0,"state_active",ent);
     
    
//Make our NPC instantly think when it spawns
    
entity_set_float(entEV_FL_nextthinkget_gametime() + 0.01)

The Inhabitant Of Heavens is offline
 



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 08:26.


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