View Single Post
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 12-03-2021 , 02:59   Re: [TF2] Green healing indicator, Ammo pack entity, Extinguish
Reply With Quote #5

Quote:
Originally Posted by ZackNAttack View Post
Is there a way to, with input being an integer, create the green text that appears from touching a health kit?
Here's a GiveHealth stock I use that recreates the green health text. If you only need the green text part, check the Event lines.
Unfortunately, recent updates to TF2 have disabled the green text now.
In the past, this stock's green text worked. Sorry for not having found this earlier.

PHP Code:
void GiveHealth(int clientint total_Heal 0bool overheal falsebool event true)
{
    if (
total_Heal <= 0) return;
    
    
int HP GetClientHealth(client);
    
int max_HP GetResourceProperty(client"m_iMaxHealth");
    if (
overheal)
    { 
max_HP max_HP+(max_HP/2); }
    
    
/*if (total_Heal+HP >= max_HP)
    { SetEntityHealth(client, max_HP); }
    else
    { SetEntityHealth(client, total_Heal+HP); }*/
    
if (HP max_HP)
    {
        if (
total_Heal+HP >= max_HP)
        { 
SetEntityHealth(clientmax_HP); }
        else
        { 
SetEntityHealth(clienttotal_Heal+HP); }
    }
    
    if (
event)
    {
        
Event player_healonhit CreateEvent("player_healonhit"true);
        
SetEventInt(player_healonhit"amount"total_Heal);
        
SetEventInt(player_healonhit"entindex"EntRefToEntIndex(client));
        
FireEvent(player_healonhit);
    }
}

int GetResourceProperty(int client, const char[] str)
{
    
int ply_manager GetPlayerResourceEntity();
    if (
RealValidEntity(ply_manager))
    {
        return 
GetEntProp(ply_managerProp_Sendstr_client);
    }
    return -
1;

__________________
ragdoll spam, that is all

Steam profile, where I game, obviously.
Youtube channel, where I do Stick Death Maze animations and some other stuff.
no plugin requests, sorry


My Plugins:
-search list-
Modified Plugins:
1 | 2 | 3 | 4

Last edited by Shadowysn; 12-03-2021 at 03:01.
Shadowysn is offline