All pastes #460555 Raw Edit

Miscellany

public text v1 · immutable
#460555 ·published 2007-04-27 03:20 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 heal_ammount = current_health * get_cvar_num("amx_healthgain_percent")
		
		new new_health = current_health + heal_ammount
		// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
		
		
		//set_user_health(killer_id, new_health)
		setHealth(killer_id,new_health)
		
		new nts[3]
		
		num_to_str(heal_ammount, nts, 4)
		client_print(killer_id,print_chat,"-=[UFI]=- You have been given %s health for a headshot kill!", nts)
		
		// 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
}