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

[TF2] Detect trigger_hurt healing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GoldTreeServers
Senior Member
Join Date: Dec 2012
Old 06-02-2015 , 08:31   [TF2] Detect trigger_hurt healing
Reply With Quote #1

Hello! Long time ago Valve broke my server dm_duel map making you cant anymore build in trigger_hurt and now I want fix this after players complaining about it. I changed trigger_hurt to healing and I want detect it. I already tried remove trigger_hurt and then replace them with trigger_multiple and detect when inside it, but I did run proble, it somehow dont work like trigger_hurt and it damage players on close it, not when they are in.

Code changes trigger_hurt to healing:
PHP Code:
public OnPluginStart()
{
    
HookEvent("game_start"OnRoundStart);
    
HookEvent("teamplay_round_start"OnRoundStart);
}

public 
Action:OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
triggerHurt INVALID_ENT_REFERENCE;
    while ((
triggerHurt FindEntityByClassname(triggerHurt"trigger_hurt")) != INVALID_ENT_REFERENCE)
    {    
        new 
Float:damage GetEntPropFloat(triggerHurtProp_Data"m_flDamage");
        if (
damage 0)
        {
            
SetEntPropFloat(triggerHurtProp_Data"m_flDamage", -damage);
            
        }
    }

__________________

Last edited by GoldTreeServers; 06-02-2015 at 08:32.
GoldTreeServers is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 06-02-2015 , 09:21   Re: [TF2] Detect trigger_hurt healing
Reply With Quote #2

Team Fortress 2 Update Released
Product Update - Valve
Feb 18

Updated trigger_hurt entities to allow Engineers building in them when they are set for zero or negative damage
__________________

Last edited by Chdata; 06-02-2015 at 09:23.
Chdata is offline
GoldTreeServers
Senior Member
Join Date: Dec 2012
Old 06-02-2015 , 10:00   Re: [TF2] Detect trigger_hurt healing
Reply With Quote #3

Quote:
Originally Posted by Chdata View Post
Team Fortress 2 Update Released
Product Update - Valve
Feb 18

Updated trigger_hurt entities to allow Engineers building in them when they are set for zero or negative damage
I'm currently trying to make trigger_hurt that have positive value damaging effect to players and turn them to healing so players can build and then detect when trigger_hurt heals you turn it back to damage ;D
__________________

Last edited by GoldTreeServers; 06-02-2015 at 10:01.
GoldTreeServers is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 06-02-2015 , 10:20   Re: [TF2] Detect trigger_hurt healing
Reply With Quote #4

Use trigger_multiple, and do HookEntityOutput for Touch/StartTouch during OnPluginStart

maybe the SDKHooks would work as well in OnEntityCreated when classname == trigger_multiple


All your current plugin does right now is force trigger_hurt to heal.
__________________

Last edited by Chdata; 06-02-2015 at 10:22.
Chdata is offline
GoldTreeServers
Senior Member
Join Date: Dec 2012
Old 06-02-2015 , 10:29   Re: [TF2] Detect trigger_hurt healing
Reply With Quote #5

Quote:
Originally Posted by Chdata View Post
Use trigger_multiple, and do HookEntityOutput for Touch/StartTouch during OnPluginStart

maybe the SDKHooks would work as well in OnEntityCreated when classname == trigger_multiple


All your current plugin does right now is force trigger_hurt to heal.
I tried already trigger_multiple but its not working... Are you even reading my post? with trigger_hurt it dont hurt when you are on secound floor but with trigger_multiple it does, SDKHooks works different then game engine? And thats why I try force trigger_hurt to heal and try to detect when trigger_hurt heals
__________________

Last edited by GoldTreeServers; 06-02-2015 at 10:30.
GoldTreeServers is offline
GoldTreeServers
Senior Member
Join Date: Dec 2012
Old 06-07-2015 , 10:53   Re: [TF2] Detect trigger_hurt healing
Reply With Quote #6

Bump
__________________
GoldTreeServers is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 06-07-2015 , 11:39   Re: [TF2] Detect trigger_hurt healing
Reply With Quote #7

Quote:
Originally Posted by GoldTreeServers View Post
I tried already trigger_multiple but its not working... Are you even reading my post? with trigger_hurt it dont hurt when you are on secound floor but with trigger_multiple it does, SDKHooks works different then game engine? And thats why I try force trigger_hurt to heal and try to detect when trigger_hurt heals
I don't know what you mean by second floor, because brush entities are merely cubes/abstract shapes, but if trigger_multiple is having an effect while the player is not actually touching it, then it sounds like you need to learn more about setting up map entities. Are you using Touch outputs? trigger_hurt does this automatically; trigger_multiple does not.

There is no SDKHook that detects healing. Only damage. It also won't detect it if you use SetHealth to lower a player's HP, because that isn't necessarily a damage infliction.
__________________

Last edited by Chdata; 06-07-2015 at 11:40.
Chdata is offline
Reply



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 06:27.


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