View Single Post
Author Message
retsam
Veteran Member
Join Date: Aug 2008
Location: so-cal
Old 10-01-2008 , 17:45   How to subtract health?
Reply With Quote #1

Hi. This is for TF2 RTD plugin, kinda been screwing around seeing if I could add some of my own skills to it. Im fairly new to SM scripting so... Im trying to figure out how one would subtract health.

What I tried didnt work. Like, this is the code for multiplying health.

Code:
SetEntityHealth(i, RoundToCeil(classHealth[GetEntProp(i, Prop_Send, "m_iClass")] * GetConVarFloat(c_Health))); // buff the health
Then above on pluginstart,
Code:
     c_Health     = CreateConVar("sm_rtd_health","1.5","Health multiplier.");
So how do you subtract health? I tried putting - where the * is, and then like "0.4" which would be 40% less. Thats clearly not correct. Is there supposed to be a minus sign in there for the cvar or what?

Last edited by retsam; 10-01-2008 at 17:50.
retsam is offline