Raised This Month: $81 Target: $400
 20% 

[CS:S] ColoredHealth


Post New Thread Reply   
 
Thread Tools Display Modes
Author
alongub
Veteran Member
Join Date: Aug 2009
Location: Israel
Plugin ID:
2365
Plugin Version:
1.0.0
Plugin Category:
Fun Stuff
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Sets the color and transparency of players based on health.
    Old 05-29-2011 , 18:18   [CS:S] ColoredHealth
    Reply With Quote #1

    ColoredHealth

    This plugin sets the color and transparency of players based on their health. It is a SourceMod port of the ColoredHealth ES plugin, but unlike it, this plugin supports any Source based games, not just CS:S. Also, this plugin is fully configurable using a KeyValues file.

    It is especially useful for surf, aim and deathmatch servers.



    Server ConVars
    • sm_coloredhealth_configfilepath - Path, relative to root sourcemod directory, to colored health levels config file.
    Configuration

    The configuration file is by default in configs/coloredhealth.txt.

    Code:
    "levels"
    {
    	"0"
    	{
    		"biggerThan"	"0.78"
    		"rgba"		"0 255 0 255"
    	}
    
    	"1"
    	{
    		"biggerThan"	"0.66"
    		"rgba"		"0 0 255 255"
    	}
    
    	"2"
    	{
    		"biggerThan"	"0.33"
    		"rgba"		"255 0 255 255"
    	}
    
    	"3"
    	{
    		"rgba"		"255 0 0 200"
    	}
    }
    The first section here says that when the relation between the player health and his maximum health is bigger than 0.78 (this is useful in games such as TF2 where health is not constant), then it renders the player in green.

    The second section says that when the player health/max health relation is above 0.66 but below 0.78 (because of the first section), then render the player in blue.
    Attached Files
    File Type: sp Get Plugin or Get Source (coloredhealth.sp - 1298 views - 2.3 KB)
    File Type: zip ColoredHealth.zip (6.7 KB, 942 views)
    __________________

    Last edited by alongub; 02-01-2013 at 21:47.
    alongub is offline
    EGood
    Member
    Join Date: Feb 2011
    Location: Israel
    Old 05-30-2011 , 09:12   Re: ColoredHealth
    Reply With Quote #2

    Good job man
    EGood is offline
    away000
    Veteran Member
    Join Date: Sep 2010
    Old 05-30-2011 , 10:39   Re: ColoredHealth
    Reply With Quote #3

    Great Job man, i will use this on my surf server to improve the fun ^^.
    away000 is offline
    khorat
    New Member
    Join Date: May 2011
    Old 05-31-2011 , 10:39   Re: ColoredHealth
    Reply With Quote #4

    Thanks Very Much
    khorat is offline
    snipercup
    Junior Member
    Join Date: Nov 2010
    Old 06-05-2011 , 10:14   Re: ColoredHealth
    Reply With Quote #5

    Could you please explain the color codes?

    The first number = red?
    The second number is Blue?
    The third number = Green? where 255 is full green?
    The fourth number = Transparancy? 0 = invisible 255 = visible?

    "255 0 0 200"
    snipercup is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 06-05-2011 , 10:19   Re: ColoredHealth
    Reply With Quote #6

    RGBA, red, green, blue, alpha.

    Nice plugin
    __________________
    Silvers is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 06-06-2011 , 11:26   Re: ColoredHealth
    Reply With Quote #7

    I haven't tested this, but does this always change uniform colors? If so, that could cause problems in TF2, where team models look identical other than the color of their clothing.... and what hats they're wearing (which is a user choice, not team choice).
    __________________
    Not currently working on SourceMod plugin development.
    Powerlord is offline
    snipercup
    Junior Member
    Join Date: Nov 2010
    Old 06-08-2011 , 15:33   Re: ColoredHealth
    Reply With Quote #8

    I noticed that the plugin changes colors when a player gets hit. Could you also make it change colors when the player gains health? That's not working for me atm, I'm running a synergy server.
    snipercup is offline
    Greyscale
    SourceMod Plugin Approver
    Join Date: Dec 2007
    Location: strYoMommasHouse[you];
    Old 06-08-2011 , 17:14   Re: ColoredHealth
    Reply With Quote #9

    You should fix this:

    Code:
    for (new i = 0; i < 32; i++)
    instead of hardcoding 32, use sizeof(g_levelData) and the compiler will do it for you.

    Otherwise, approved.
    __________________
    Greyscale is offline
    alongub
    Veteran Member
    Join Date: Aug 2009
    Location: Israel
    Old 01-28-2012 , 22:16   Re: ColoredHealth
    Reply With Quote #10

    Quote:
    Originally Posted by Greyscale View Post
    You should fix this:

    Code:
    for (new i = 0; i < 32; i++)
    instead of hardcoding 32, use sizeof(g_levelData) and the compiler will do it for you.

    Otherwise, approved.
    Fixed, thanks.
    alongub is offline
    Reply


    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 12:15.


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