.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > SDK Programming discussions > Half-Life 2 SDK
Half-Life 2 SDK For developments focused around the Half-Life 2 engine Half-Life 2

Reply
 
Thread Tools
help with hl2 server plugin
Old
  (#1)
Austin
Moderator
 
Austin's Avatar
 
Status: Offline
Posts: 403
Join Date: Nov 2003
Default help with hl2 server plugin - 03-01-2006

I need to port this old metamod "no headshots to humans" plugin to cs source. I have complied the server plugin sample but know almost nothing about the hl2 sdk.

Can anyone give me some clues on how I would port these few lines into a hl2 server plugin?

Code:
//---------------------------------------------------------------------
// Disallow headshot damange to human players
//---------------------------------------------------------------------------
void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr)
{
    TRACE_LINE(v1, v2, fNoMonsters, pentToSkip, ptr);
    // disallow head shots to human players
    if ( ( (1<<HITGROUP_HEAD) & (1<<ptr->iHitgroup)) &&
             !(ptr->pHit->v.flags & FL_FAKECLIENT)            )
    {
        ptr->flFraction = 1.0;
        RETURN_META(MRES_SUPERCEDE);
    }
    else
        RETURN_META(MRES_IGNORED);
}
Thanks a million.
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com