Raised This Month: $ Target: $400
 0% 

catching a change in player's health.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
P i x e L
Junior Member
Join Date: Jun 2009
Location: eBaum's World
Old 06-13-2009 , 18:38   catching a change in player's health.
Reply With Quote #1

How can I make something happen every time a player's health changes?
I don't know how to do this check =\
Thanks!

Also - is there a way to catch a change in a player's money amount? Thanks again!

Last edited by P i x e L; 06-13-2009 at 18:43.
P i x e L is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 06-13-2009 , 18:46   Re: catching a change in player's health.
Reply With Quote #2

Ham_TakeDamage

Or

register_menssege( get_user_msgid("Health"), "you_public")
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
P i x e L
Junior Member
Join Date: Jun 2009
Location: eBaum's World
Old 06-13-2009 , 18:48   Re: catching a change in player's health.
Reply With Quote #3

I'm really not familiar with Ham do you think you might be able to use it in a quick example if it's not too much to ask? =\ Thanks ;)
P i x e L is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-13-2009 , 20:12   Re: catching a change in player's health.
Reply With Quote #4

Ham is not needed unless you are looking to alter\block damage to the victim.

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

#define PLUGIN "Change in Health"
#define VERSION "1.0"
#define AUTHOR "bugsy"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event"Health" "fw_Health" "b" );
}

public 
fw_Healthid )
{
    
client_printid print_chat "Your health is now %d" read_data) );

PHP Code:
RegisterHamHam_TakeDamage "player" "fw_HamTakeDamage" )

public 
fw_HamTakeDamageiVictim iInflictor iAttacker FloatfDamage iBitDamage 
{
      
//iVictim took damage

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


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