View Single Post
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 12-11-2018 , 12:58   Re: [CSGO] Axe and hammer pick up
Reply With Quote #17

https://github.com/Bara/TroubleinTer.../ttt.inc#L1030
Spanner, Axe and Hammer are known as "weapon_melee".

//Edit:
Code:
stock int TTT_HasClientMelee(int client)
{
    for(int offset = 0; offset < 128; offset += 4)
    {
        int weapon = GetEntDataEnt2(client, FindSendPropInfo("CBasePlayer", "m_hMyWeapons") + offset);

        if (IsValidEntity(weapon))
        {
            char sClass[32];
            GetEntityClassname(weapon, sClass, sizeof(sClass));

            if ((StrContains(sClass, "melee", false) != -1))
            {
                return weapon;
            }
        }
    }

    return -1;
}
__________________
Discord (Bara#5006) | My Plugins (GitHub)
You like my work? Support is not a crime.

Last edited by Bara; 12-11-2018 at 13:17.
Bara is offline