View Single Post
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 03-10-2008 , 01:00   Re: Zero (0) HP Bug Fix
Reply With Quote #10

This is not needed: set_pev(id, pev_health, ++health);

you just need to make sure the hud does not show 0 by using:
set_msg_arg_int(1, get_msg_argtype(1), 1);

----------------
You also don't need get_msg_argtype(1) and can just use ARG_BYTE for:
set_msg_arg_int(1, ARG_BYTE, 1);

what i used:
Code:
public message_Health(msgid, dest, id)
{
	if(!is_user_alive(id))
		return PLUGIN_CONTINUE;

	static hp;
	hp = get_msg_arg_int(1);

	if(hp > 0 && (hp % 256) == 0)
	{
		set_msg_arg_int(1, ARG_BYTE, ++hp);
	}
	return PLUGIN_CONTINUE;
}

Last edited by vittu; 03-10-2008 at 01:20.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu