Hello!
I have some problems with my plugin, DeatMsg and the Damage events doesn't work on half-life. Anyone knows how to make this to work or maybe another method?
the code:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>
#define PLUGIN "The Hidden: Not Source"
#define VERSION "0.4"
#define AUTHOR "Hip_hop_x"
new is_hidden[33]
new g_maxplayers
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg", "event_DeathMsg", "b")
register_event("Damage", "event_Damage", "b")
}
public event_Damage(victim) {
new victim
get_user_attacker(victim)
new damage = read_data(2)
new Float:extra_damage = damage / 100 * get_cvar_num("hidden_damage")
if(is_hidden[victim]) {
fm_fakedamage(victim, "", extra_damage, DMG_ACID)
}
public event_DeathMsg() {
new killer = read_data(1)
new victim = read_data(2)
new name[32]
if ( is_hidden[victim] == 1 ) {
set_hudmessage(50, 205, 50, -1.0, 0.40, 2, 0.02, 4.0, 0.01, 0.1, 7)
show_hudmessage(0, "Hidden died! The new hidden is %s!", name)
is_hidden[killer] = 1 //killer is now the new hidden
is_hidden[victim] = 0 //victim is not hidden
get_user_name(killer, name, 31)
if ( ! victim )
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
//... the rest of code works.