AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to set body parts ? (https://forums.alliedmods.net/showthread.php?t=319822)

spamipolito 11-21-2019 13:49

How to set body parts ?
 
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:

https://i.imgur.com/iZlrFMu.jpg

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

georgik57 11-23-2019 08:33

Re: How to set body parts ?
 
I'm not 100% sure but I think it's all about the hitboxes.


All times are GMT -4. The time now is 02:50.

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