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

How to subtract health?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 


Thread Tools
Display Modes

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 17:25.


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