Thread: Health Bonus!
View Single Post
dj_freeze
Veteran Member
Join Date: Dec 2009
Location: Looking for you!
Old 03-12-2010 , 15:02   Re: Health Bonus!
Reply With Quote #3

Quote:
Originally Posted by Brreaker View Post
I guess you should use:
Code:
#include <amxmodx> 
#include <fun> 
  
#define HEALTH_BONUS 15 
#define HEALTH_MAX 100 
  
public plugin_init() 
        register_event("DeathMsg", "DeathMsg", "a", "1>0"); 
  
public DeathMsg() 
{ 
        new Killer = read_data( 1 ); 
         
        if( Killer == read_data( 2 ) ) 
                return; 
         
        new Health = get_user_health(Killer); 
  
        if (Health < 100 && Health > 1) 
                set_user_health( Killer, min( Health + HEALTH_BONUS, HEALTH_MAX ) ); 
}
because when he is dead, it has health 0, and automaticaly he gets 100, so the server thinks he is alive
Thanks... I'll try and write back
__________________
dj_freeze is offline
Send a message via Skype™ to dj_freeze