AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [TF2] Green healing indicator, Ammo pack entity, Extinguish (https://forums.alliedmods.net/showthread.php?t=318180)

ZackNAttack 08-18-2019 11:18

[TF2] Green healing indicator, Ammo pack entity, Extinguish
 
I have three questions:

Is there a way to, with input being an integer, create the green text that appears from touching a health kit?

What is the name for the ammo pack entity dropped when someone dies?

How do I extinguish players?

Powerlord 08-18-2019 11:26

Re: [TF2] Green healing indicator, Ammo pack entity, Extinguish
 
2. I believe it's tf_ammo_pack

3. I believe it's the generic ExtinguishEntity function.

ZackNAttack 08-18-2019 12:06

Re: [TF2] Green healing indicator, Ammo pack entity, Extinguish
 
Quote:

Originally Posted by Powerlord (Post 2663698)
2. I believe it's tf_ammo_pack.

Does HookEntityOutput("tf_ammo_pack","OnPlayerTouc h",EntityOutput_AmmoPackMedium); not work for detecting on-death ammo packs being touched?

Quote:

Originally Posted by Powerlord (Post 2663698)
3. I believe it's the generic ExtinguishEntity function

Is there some kind of function to turn client id into entity id or something? For some reason it worked the first time but not afterwards.

ZackNAttack 10-22-2019 21:11

Re: [TF2] Green healing indicator, Ammo pack entity, Extinguish
 
I found it! Remove the condition TF_COND_BURNING / condition 22

Shadowysn 12-03-2021 02:59

Re: [TF2] Green healing indicator, Ammo pack entity, Extinguish
 
Quote:

Originally Posted by ZackNAttack (Post 2663695)
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;




All times are GMT -4. The time now is 08:30.

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