Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2024, 06:27:43 PM
Home Help Login Register
News: Trouble in Terrorist Town? Site here, forum here.

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Masking Health Id's (Healthy, Wounded etc)
Pages: [1]
Author Topic: Masking Health Id's (Healthy, Wounded etc)  (Read 2935 times)
GoodNewsEveryone
Poster

Posts: 2


« on: February 08, 2011, 08:47:20 AM »

Hello Guys.

I'm just wondering if there is a way to change a health id from say wounded to healthy without changing the players health.


Thanks in advance.
Good News Everyone.
Cush
Poster

Posts: 79


« Reply #1 on: February 08, 2011, 04:03:48 PM »

At the bottom of util.lua there's a bit for controlling the health display -

if CLIENT then
  local healthcolors = {
     healthy = Color(0,255,0,255),
     hurt    = Color(170,230,10,255),
     wounded = Color(230,215,10,255),
     badwound= Color(255,140,0,255),
     death   = Color(255,0,0,255)
  };

  function util.HealthToString(health)
     if health > 90 then
        return "hp_healthy", healthcolors.healthy
     elseif health > 70 then
        return "hp_hurt", healthcolors.hurt
     elseif health > 45 then
        return "hp_wounded", healthcolors.wounded
     elseif health > 20 then
        return "hp_badwnd", healthcolors.badwound
     else
        return "hp_death", healthcolors.death
     end
  end


You could put your own statement in there to, say, check if they are using a certain item or something then just return healthy.

For example :


  function util.HealthToString(health)
   
      if HPChanger == true then
        return "hp_healthy", healthcolors.healthy

     elseif health > 90 then
        return "hp_healthy", healthcolors.healthy
     elseif health > 70 then
        return "hp_hurt", healthcolors.hurt
     elseif health > 45 then
        return "hp_wounded", healthcolors.wounded
     elseif health > 20 then
        return "hp_badwnd", healthcolors.badwound
     else
        return "hp_death", healthcolors.death
     end
  end


Obviously HPChanger isnt a real variable in this case, but you'd put whatever you wanted in there to check.

Hope that helps.
« Last Edit: February 08, 2011, 07:33:38 PM by Cush »
GoodNewsEveryone
Poster

Posts: 2


« Reply #2 on: February 09, 2011, 06:03:11 AM »

Thanks for the quick reply. I'll see if it works.
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Masking Health Id's (Healthy, Wounded etc) « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.007 seconds with 17 queries.