PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
new g_max_players
public plugin_init() {
register_plugin("Syphon Health", "1.0", "Jengerer")
register_event("Damage", "SyphonHealth", "b", "2!0")
g_max_players = get_maxplayers()
}
public SyphonHealth(Victim) {
if( Victim < 1 || Victim > g_max_players) //check if Victim is a valid player id
return PLUGIN_CONTINUE
new Attacker = get_user_attacker(Victim)
if( Attacker < 1 || Attacker > g_max_players) //check if Attacker is a valid player id
return PLUGIN_CONTINUE
new Health = get_user_health(Attacker)
new Damage = read_data(2)
if (Attacker) {
set_user_health(Attacker, (Health+Damage));
set_hudmessage(200, 0, 0, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, 7);
show_hudmessage(Attacker,"%i+ (%i)", Damage, Health+Damage);
}
return PLUGIN_CONTINUE
}
__________________