Raised This Month: $32 Target: $400
 8% 

melee weapon in incapable


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gold Fish
Senior Member
Join Date: Mar 2020
Old 03-25-2021 , 18:50   melee weapon in incapable
Reply With Quote #1

How do I find out a melee weapon when a player is incapacitated?
Gold Fish is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 03-25-2021 , 19:55   Re: melee weapon in incapable
Reply With Quote #2

Here's how I do it in my Mutant Tanks plugin:
PHP Code:
char sWeapon[32];
int iSlot 0;
if (
GetEntProp(survivorProp_Send"m_isIncapacitated"1) == || GetEntProp(survivorProp_Send"m_isHangingFromLedge") == 1// Only check if player is incapacitated or hanging from ledge.
{
    
int iOffset g_bLinux 16320 16340// Offsets found in: CTerrorPlayer::OnIncapacitatedAsSurvivor(CTakeDamageInfo const&)
        
iMelee GetEntDataEnt2(survivoriOffset);

    switch (
IsValidEntity(iMelee))
    {
        case 
trueiSlot iMelee;
        case 
falseiSlot GetPlayerWeaponSlot(survivor1);
    }
}
else
{
    
iSlot GetPlayerWeaponSlot(survivor1);
}

if (
iSlot MaxClients)
{
    
GetEntityClassname(iSlotsWeaponsizeof(sWeapon));
    if (
StrEqual(sWeapon"weapon_melee"))
    {
        
GetEntPropString(iSlotProp_Data"m_strMapSetScriptName"sWeaponsizeof(sWeapon)); // Get the melee weapon's script name.
    
}

__________________
Psyk0tik is offline
Reply


Thread Tools
Display Modes

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


All times are GMT -4. The time now is 14:38.


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