View Single Post
Geel9
Senior Member
Join Date: Mar 2009
Old 07-22-2010 , 10:41   Re: [TF2]Repair Node(V1.8)
Reply With Quote #41

Quote:
Originally Posted by Eggman View Post
I found bug: repair node's heal to building is fake... it's show on HUD, but enemy engineer can kill "fully healed" SG lvl3 on 1 hi...it's do not really healing

HTML Code:
public Void:SetHealthOfEnt(any:entl, String:classname[64], any:health){
	new Maxhealth = GetEntProp(entl, Prop_Send, "m_iMaxHealth")
	new entvalue=GetEntProp(entl, Prop_Send, "m_iHealth") 
	new newhealth = entvalue + health;
	if(entvalue < 200){
		if(newhealth < Maxhealth){
			SetEntProp(entl, Prop_Send, "m_iHealth", newhealth)
		}
		else{
			SetEntProp(entl, Prop_Send, "m_iHealth", Maxhealth)
		}
	}
}
My version has really healing.
HTML Code:
public Void:SetHealthOfEnt(any:entl, String:classname[64], any:health){
	new Maxhealth = GetEntProp(entl, Prop_Send, "m_iMaxHealth")
	new entvalue=GetEntProp(entl, Prop_Send, "m_iHealth") 
	new newhealth = entvalue + health;
	if(entvalue < 200){
		if(newhealth < Maxhealth){
			SetVariantString("-%i",health);
			AcceptEntityInput(ent, "RemoveHealth");
		}
		else{
			SetEntProp(entl, Prop_Send, "m_iHealth", Maxhealth)
		}
	}
}

I fixed it using a less hacky method that I'm entirely unsure as to why I didn't use in the first place.
Geel9 is offline