Raised This Month: $ Target: $400
 0% 

How to set body parts ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
spamipolito
Junior Member
Join Date: Jun 2018
Old 11-21-2019 , 13:49   How to set body parts ?
Reply With Quote #1

Hi guys. I created a zombie NPC that follows and attacks the players. But I have a doubt, how do I set parts to the body of the NPC?

Example:



Code where you created the npc:

PHP Code:
public createNpc() {    
    new 
iEnt;
    
    
g_TotalMonsters++
    
g_MonstersAlive++
    
    new 
Float:vecMins[3];
    new 
Float:vecMax[3];
    
    new 
iHealth STRUCT_OLEADA[g_OleadaNivel][ZOMBIES_HP]
    
    
iEnt create_entity("info_target");
        
    if(
is_valid_ent(iEnt))
    {

        
entity_set_string(iEntEV_SZ_classnameENT_NPC_CLASSNAME);
            
        
dllfunc(DLLFunc_SpawniEnt);
            
        
entity_set_model(iEntNPC_MODELS);
        
entity_set_float(iEntEV_FL_healthfloat(iHealth));
        
entity_set_float(iEntEV_FL_takedamageDAMAGE_NO);
            
        
entity_set_vector(iEntEV_VEC_anglesFloat:{0.00.00.0});

        
entity_set_vector(iEntEV_VEC_velocityFloat:{0.00.0340.0});
            
        
entity_set_int(iEntEV_INT_solidSOLID_BBOX);
        
entity_set_int(iEntEV_INT_movetypeMOVETYPE_PUSHSTEP);
            
        
entity_set_float(iEntEV_FL_gravity1.0);
           
        
NPC_PlayAction(iEntIA_ACTIONS[0][NPC_SEQUENCE], IA_ACTIONS[0][NPC_ANIMTIME], IA_ACTIONS[0][NPC_FRAMERATE])

        
entity_set_int(iEntZOMBIE_MAXHEALTHiHealth);
        
entity_set_int(iEntZOMBIE_TARGET0);
            
        
vecMins Float:{-16.0, -16.0, -36.0};
        
vecMax Float:{16.016.016.0};

        
set_rendering(iEntkRenderFxGlowShell000kRenderTransAlpha150)
            
        
entity_set_size(iEntvecMinsvecMax);
        
//entity_set_origin(iEnt, vecOrigin);

        
entity_set_byte(iEnt,EV_BYTE_controller1,125);
            
        
entity_set_vector(iEntEV_VEC_minsvecMins);
        
entity_set_vector(iEntEV_VEC_maxsvecMax);
            
        
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 4.0);

        
PlaySound(npc_spawn[random_num(0sizeof npc_spawn -1)])
    }


Sorry for my english
spamipolito is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 11-23-2019 , 08:33   Re: How to set body parts ?
Reply With Quote #2

I'm not 100% sure but I think it's all about the hitboxes.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
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 02:50.


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