All pastes #460565 Raw Edit

Anonymous

public text v1 · immutable
#460565 ·published 2007-04-27 03:28 UTC
rendered paste body
public headShot()
{
	new killer_id = read_data(1)
	
	if (get_user_flags(killer_id) & ADMIN_LEVEL_A)
	{
		// im guessing the error is in here, cause the health isn't 
		// being added as well as displaying
		new current_health = get_user_health(killer_id)
		
		new Float:heal_ammount = current_health * get_cvar_float("amx_healthgain_percent")
		
		new Float:new_health = current_health + heal_ammount
		// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
		
		
		//set_user_health(killer_id, new_health)
		setHealth(killer_id,floatround(new_health))
		
		client_print(killer_id,print_chat,"-=[UFI]=- You have been given %d health for a headshot kill!", floatround(heal_ammount))
		
		// debug crap
		//client_print(killer_id,print_chat,"Health: %d", current_health)
		//client_print(killer_id,print_chat,"current_health * hgpercent: %d", heal_ammount)
		//client_print(killer_id,print_chat,"new_health: %d", new_health)

	}

	return PLUGIN_HANDLED
}