View Single Post
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 01-26-2014 , 21:17   Re: Cannot detect Darwin Danger Shield?
Reply With Quote #3

I switched back to it and it seems to be working again. I moved off it before because it broke though...

Edit:

PHP Code:
stock bool:bVictimHasDarwin(victim//GetIndexOfWeaponSlot(victim, TFWeaponSlot_Secondary) == 231
{
    new 
ent = -1;

    while ((
ent FindEntityByClassname2(ent"tf_wearable")) != -1)
    {
        new 
idx GetEntProp(entProp_Send"m_iItemDefinitionIndex");

        if (
GetEntPropEnt(entProp_Send"m_hOwnerEntity") == victim && idx == 231)
        {
            return 
true;
        }
    }

    return 
false;
}

stock FindEntityByClassname2(startEnt, const String:classname[])
{
    
/* If startEnt isn't valid shifting it back to the nearest valid one */
    
while (startEnt > -&& !IsValidEntity(startEnt))
    {
        
startEnt--;
    }

    return 
FindEntityByClassname(startEntclassname);

This was working perfectly until just recently, I was able to survive a headshot (meaning the check failed).

The server is sniper only due to class restrictions.

It seems I'm able to one shot some people using it, another person is complaining he can't one shot anyone using it.

Edit: As it's a sniper only server...

PHP Code:
if (GetClientHealth(iVictim) > 125)
{
     
//He has tha derwan.

And if it were non-sniper only, would just have to check if class == sniper too.

Edit: Wat, that doesn't work either. At least now I know something else must be wrong.

Edit 2: Updated my OP with the full OnTakeDamage check.

Things I'm sure of:

The bitwise checks aren't the problem.
The bodyshot nerf always works.
The melee nerf always works.
__________________

Last edited by Chdata; 01-27-2014 at 17:41.
Chdata is offline