Raised This Month: $ Target: $400
 0% 

Getting the Weapon inside Event OnTakeDamage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
InsidiousGnomes
Member
Join Date: Nov 2008
Old 11-24-2008 , 14:32   Re: Getting the Weapon inside Event OnTakeDamage
Reply With Quote #4

attacker is a clientID right? When I shoot a bot in CS: S (me being the attacker in this case), GetClientWeapon reports an invalid client id = 0. I don't see how *my* client id could equal 0. Is there a way to get the weapon name from inflictor? I've tried GetEntityNetClass() and GetEdictClassname() to no avail.

Code:
public Action:TakeDamageFunction(client, &inflictor, &attacker, &Float:Damage, &DamageType, &AmmoType)
{

    new String:WeaponName[256];
    GetClientWeapon(attacker, WeaponName, sizeof(WeaponName));
    
    PrintToChatAll("Weapon is %s", WeaponName);
    

    
    return Plugin_Changed; // tells the extension something was changed use the new value!  
}

Last edited by InsidiousGnomes; 11-24-2008 at 14:36.
InsidiousGnomes is offline
 



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 18:26.


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