AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   UTIL_MakeVectors replacement (https://forums.alliedmods.net/showthread.php?t=128185)

HLM 05-29-2010 16:56

UTIL_MakeVectors replacement
 
once again, its that c++ plugin, and I have this line:
PHP Code:

UTIL_MakeVectors(pEntity->v.v_angle); 

I know what its saying, but I dont know if I really need it, and beyond that, I dont know HOW to use it. (I refuse to use orpheu on the grounds that I havent fully gone into it and investigated it, if I was to use orpheu, then I would learn nothing from doing this project)

CODEBLOCK:

PHP Code:

    // check for pushing sentry
    
if(entity_get_int(pEntityEV_INT_playerclass) == PC_ENGINEER && PlayerHasTech(TECH_SENTRY_PUSHpEntity))
    {
        
//if(pEntity->v.button & IN_USE)
        
if(Buttons IN_USE)
        {
            
UTIL_MakeVectors(pEntity->v.v_angle);
            
TraceResult trtr2;
            
UTIL_TraceLine(pEntity->v.origin pEntity->v.view_ofspEntity->v.origin pEntity->v.view_ofs + (gpGlobals->v_forward*48), dont_ignore_monsterspEntity, &tr);
            if(
tr.flFraction != 1.0 && tr.pHit && tr.pHit->v.classname)
            {
                if((
pSentryPair[ENTINDEX(tr.pHit)] != NULL) && !pSentryPair[ENTINDEX(tr.pHit)]->free)
                {
                    
edict_t *pBase pSentryPair[ENTINDEX(tr.pHit)];
                    
tr.pHit->v.origin pBase->v.origin Vector(00SENTRY_BASE_OFFSET_Z);
                    
pBase->v.velocity Vector((tr.pHit->v.origin pEntity->v.origin).x, (tr.pHit->v.origin pEntity->v.origin).y0).Normalize() * 400;
                    
tr.pHit->v.velocity pBase->v.velocity;
                    
pBase->v.movetype MOVETYPE_PUSHSTEP;
                    
pBase->v.nextthink gpGlobals->time 0.1;
                    
pBase->v.solid SOLID_SLIDEBOX;
                }
            }
        }
    } 

my defines and whatnot are existant, I have everything (like, 3 displayed lines) fixed up to that point.

Thanks for atleast reading this, lol.

Alka 05-29-2010 18:14

Re: UTIL_MakeVectors replacement
 
PHP Code:

new Float:vAngle[3];
pev(entpev_v_anglevAngle);

engfunc(EngFunc_MakeVectorsvAngle); 


HLM 05-29-2010 19:34

Re: UTIL_MakeVectors replacement
 
one more thing, looking at the codeblock, I have this line:
PHP Code:

UTIL_TraceLine(pEntity->v.origin pEntity->v.view_ofspEntity->v.origin pEntity->v.view_ofs + (gpGlobals->v_forward*48), dont_ignore_monsterspEntity, &tr); 

where do I get "(gpGlobals->v_forward*48)" from? I know what *48 is, but what can I do to get the gpglobals v_forward part?

thanks for the assistance with the makevectors, alka

Arkshine 05-30-2010 04:43

Re: UTIL_MakeVectors replacement
 
global_get( glb_v_forward, ... );


All times are GMT -4. The time now is 05:22.

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