Pyro auto-airblast

Posts 1–6 of 6 · Page 1 of 1
Pyro auto-airblast
Sorry if this is in the wrong section, but I found this code on this forum, and i was wondering if anyone could help me compile this.

Thanks in advance.

Code:
// Gets the flags for this projectile from a C_BaseEntity* 
// If it returns 0, it is not a projectile. 
int CAirblast::ProjFlags(C_BaseEntity *pProj) 
{ 
    switch (GetClassID(pProj)) 
    { 
    case CIDCTFStunBall: return ABF_STUNBALL; 
    case CIDCTFProjectile_Rocket: return ABF_ROCKET; 
    case CIDCTFGrenadePipebombProjectile: 
        { 
            dt_TFProjectile_Pipebomb dtProj(pProj); 
            if ( dtProj.iType()==PROJ_GRENADE ) 
                return (dtProj.bTouched())?ABF_BOUNCED:ABF_GRENADE; 
            else 
                return ABF_STICKY; 
        } 
    case CIDCTFProjectile_Arrow: return ABF_ARROW; 
    case CIDCTFProjectile_Flare: return ABF_FLARE; 
    case CIDCTFProjectile_Jar: return ABF_JARATE; 
    } 
    return 0; // Not a projectile 
} 
// Fires a simple ray and if it gets close enough it is considered visible. 
bool CAirblast::IsVisible(Vector &vPlayer, Vector &vProj) 
{ 
    if ( !g_pEngineTrace ) return true; 

    trace_t pTrace; 
    Ray_t pRay; 
    pRay.Init(vPlayer,vProj); 
    CTraceAirblast traceFilter; 
    g_pEngineTrace->TraceRay( pRay, MASK_AIRBLAST, &traceFilter, &pTrace ); 

    return pTrace.fraction>=0.99f; 
} 
// FOV test, you have to write your own CalcAngles(), ClampAngles() and InFov(). 
bool CAirblast::IsInFov(Vector &vPlayer, Vector &vProj) 
{ 
    QAngle qPlayer, qProj, qDiff; 
    g_pEngine->GetViewAngles(qPlayer); 
    CalcAngles(vPlayer, vProj, qProj); 
    qDiff = qPlayer-qProj; 
    ClampAngles(qDiff); 
    Msg("Diff = %f, %f\n", qDiff.x, qDiff.y); 
    return InFov(qDiff, 30.0f); 
} 
// Filter test, checks if the entity is not of your team and checks the flags of this projectile 
bool CAirblast::CProjFilter::Test(IClientEntity *ient) 
{ 
    C_BaseEntity *pEnt = static_cast<C_BaseEntity*>(ient); 
    return ((ProjFlags(pEnt)&m_fFlags) && pEnt->GetTeamNumber()!=m_iTeam); 
} 
// CTraceFilter, simple stuff. 
bool CAirblast::CTraceAirblast::ShouldHitEntity(IHandleEntity *pHandleEntity, int contentsMask) 
{ 
    C_BaseEntity *pEnt = static_cast<C_BaseEntity*>(pHandleEntity); 
    return !( GetClassID(pEnt)==CIDCTFPlayer || GetClassID(pEnt)==CIDCFuncRespawnRoomVisualizer ); 
}
You need Source SDK from steam and in source SDK->choose game engine(your choice)->click "Create a Mod"->Select "Only source code"->After Installing->open your new mod in visual studio and start coding things
I downloaded the Source SDK and created a mod, now how do i code it? Sorry but i'm a n00b in hacking :P
Quote Originally Posted by loller26 View Post
I downloaded the Source SDK and created a mod, now how do i code it? Sorry but i'm a n00b in hacking :P
Sorry for a late answer ,Search in google and you will find some tuts
There's a Easier way I think Copy the Source Code
and Go to C# download if you don't have it Select "New Project" and choose "Class Library" Delete everything on screen (C#) and paste the code (If the code has a Blue Text that says using and the word next to it underlined with red swiggles you need to refer that word the the .dll in the TF2) Once you've done that select "debug" and build if its successful you did it if it failed well you did something wrong. After that as far as I know inject the .dll (Auto-Airblast) from your Visual Studio C# projects with a Injector and see if it works
Sorry if it didn't work only now I'm learning the ins and outs of C#/C++
this shit is from 2009 good job also original credits go to casual hacker
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?