Raised This Month: $ Target: $400
 0% 

HAM_TAKEDAMAGE problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-18-2010 , 11:46   Re: HAM_TAKEDAMAGE problem
Reply With Quote #3

Quote:
Originally Posted by minimiller View Post
public fwdTakeDamage(iVictim, iWeapon, iAttacker, Float:flDamage, iDmgBits)
This is wrong, second param is not the weapon, it's in most cases the same as attacker. It can be the nade id when it is a HE.

PHP Code:
#include <amxmodx>
#include <hamsandwich>

new const VERSION[] = "0.0.1"

public plugin_init()
{
    
register_plugin("Regeneration"VERSION"ConnorMcLeod")

    
RegisterHam(Ham_TakeDamage"player""CBasePlayer_TakeDamage")
}

public 
CBasePlayer_TakeDamage(id eInflictoreAttackerFloat:flDamagebitsDamageType )
{
    
// First check if attacker is a player
    
if( eAttacker != id && is_user_connectedeAttacker ) )
    {
        new 
szName[32]
        
get_user_name(idszNamecharsmax(szName))
        
client_print(eAttackerprint_chat"You've just hit %s! Nice work."szName)
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 08:47.


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