Raised This Month: $51 Target: $400
 12% 

[TF2]Repair Node(V1.8)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Geel9
Senior Member
Join Date: Mar 2009
Old 07-22-2010 , 10:41   Re: [TF2]Repair Node(V1.8)
Reply With Quote #33

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
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode