I always thought that the Event names were Case-Sensitive, but I could be wrong..
Either way, you should change:
Code:
register_event("deathmsg", "deathmsge", "a")
//to
register_event("DeathMsg", "deathmsge", "a")
Anyway, apart from that, in your DeathMsg function:
Code:
new id = read_data( 1 ) ;
// should be:
new id = read_data( 2 ) ;
And, you are trying to give health back to the dead player, which isn't going to happen.. he is already dead.. You want to give health to the attacker who killed him, so you could try:
Code:
new iAttackerID = get_user_attacker( id )
Oh, and you should make sure that the victim and attacker are valid players:
Code:
if( !is_user_connected(id) )
return PLUGIN_CONTINUE
So overall, your DeathMsg function should look like:
Code:
public deathmsge () {
new id = read_data( 2 );
if( !is_user_connected(id) )
return PLUGIN_CONTINUE
new iAttackerID = get_user_attacker( id )
if( !is_user_connected(iAttackerID) )
return PLUGIN_CONTINUE
new health = get_user_health ( iAttackerID );
set_user_health ( iAttackerID, health + 10 )
client_print ( iAttackerID, print_center, "Your Victims Blood Gets You 10 HP")
// DONT return PLUGIN_HANDLED from hooked events!
return PLUGIN_CONTINUE
}
Oh, and your vampire() function is completely useless as it is, and I don't know what you wanted to do with it, but it is logically messed up!! No offense..
Anyway, I hope that helps!