Raised This Month: $ Target: $400
 0% 

NPC Duck problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
spamipolito
Junior Member
Join Date: Jun 2018
Old 06-13-2018 , 07:07   NPC Duck problem
Reply With Quote #1

Hi guys. I'm trying to make a perfect npc. I have a problem.

When being crouched, it works perfect, or so I think.. But when standing, the NPC gets on the ground

This is my code:
PHP Code:
        case ACTIVITY_DUCK:
        {
            
NPC_PlayAction(iEntAI_ACTIONS[5][NPC_SEQUENCE], AI_ACTIONS[5][NPC_ANIMTIME], AI_ACTIONS[5][NPC_FRAMERATE])

            
NPC_MoveToTarget(iEntvecVictimOrigin240.0)

            new 
Float:vecMins[3];
            new 
Float:vecMax[3];
            
//new Float:VecSize[3]
    
            
vecMins Float:{-16.0, -16.0, -18.0};
            
vecMax Float:{16.016.032.0};
            
//VecSize = Float:{32.0, 32.0, 50.0};
    
            //entity_set_size(iEnt, vecMins, vecMax);
    
            
entity_set_vector(iEntEV_VEC_minsvecMins);
            
entity_set_vector(iEntEV_VEC_maxsvecMax);

            
client_print(0print_chat"Duck")

            if(
fDistance <= 64.0)
            {    
                
// Sequence Duck And Attack 

                
entity_set_int(iEntEV_INT_sequence81);
                
entity_set_float(iEntEV_FL_animtimeg_animtime);
                
entity_set_float(iEntEV_FL_framerateg_framerate);

                
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 0.5);
            
                return;    

             }

            
//if( !(pev(iVictim, pev_oldbuttons) & IN_DUCK) )
            //{
                
entity_set_int(iEntZOMBIE_ACTIVITYACTIVITY_STAND)

            
//}

            
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 0.5);
            
            return;

        }
        case 
ACTIVITY_STAND:
        {
            
NPC_PlayAction(iEntAI_ACTIONS[0][NPC_SEQUENCE], AI_ACTIONS[0][NPC_ANIMTIME], AI_ACTIONS[0][NPC_FRAMERATE])

            new 
Float:vecMins[3];
            new 
Float:vecMax[3];
           
// new Float:VecSize[3]
    
            
vecMins Float:{-16.0, -16.0, -36.0};
            
vecMax Float:{16.016.036.0};
            
//VecSize = Float:{32.0, 32.0, 72.0};
    
            //entity_set_size(iEnt, vecMins, vecMax);
    
            
entity_set_vector(iEntEV_VEC_minsvecMins);
            
entity_set_vector(iEntEV_VEC_maxsvecMax);

            
entity_set_int(iEntZOMBIE_ACTIVITYACTIVITY_RUN)

            
client_print(0print_chat"Stand")

            
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 0.5);

            return;
        } 
Duck:



Problem:



Sorry for my english, I'm spanish speaking

Last edited by spamipolito; 06-13-2018 at 07:10.
spamipolito 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 04:40.


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