Raised This Month: $ Target: $400
 0% 

register_event damage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-12-2009 , 13:47   Re: register_event damage
Reply With Quote #6

Here's a little example

PHP Code:
new g_MaxPlayers;
#define IsPlayer(%1)  ( 1 <= %1 <= g_MaxPlayers )

//plugin_init()
RegisterHamHam_TakeDamage "player" "fw_HamTakeDamage" );
g_MaxPlayers get_maxplayers();

public 
fw_HamTakeDamageiVictim iInflictor iAttacker Float:fDamage iBitDamage 
{   
    if ( 
IsPlayeriAttacker ) )
     {
        static 
szName33 ];
        
get_user_nameiAttacker szName 32 );
        
client_printiVictim print_chat "You were attacked by %s" szName );
        
//You can block the victim from taking damage with: return HAM_SUPERCEDE;
    
}

__________________
Bugsy 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 13:58.


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