AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   catching a change in player's health. (https://forums.alliedmods.net/showthread.php?t=94657)

P i x e L 06-13-2009 18:38

catching a change in player's health.
 
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!

AntiBots 06-13-2009 18:46

Re: catching a change in player's health.
 
Ham_TakeDamage

Or

register_menssege( get_user_msgid("Health"), "you_public")

P i x e L 06-13-2009 18:48

Re: catching a change in player's health.
 
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 ;)

Bugsy 06-13-2009 20:12

Re: catching a change in player's health.
 
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




All times are GMT -4. The time now is 13:57.

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