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

[HL2DM] Check if a player is using a health charger


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
scorpius2k1
Senior Member
Join Date: Feb 2016
Old 05-19-2020 , 13:40   [HL2DM] Check if a player is using a health charger
Reply With Quote #1

Is there a way to tell if a player is using a health charger? If so, how to get the client index as well?


EDIT: I would like to avoid using any TR_Trace functions, as there are situations where a player is not facing the charger directly while using it.

__________________
{__ PIRATES COVE __} ● HIGH-KILL Community | Stats ●
Half-Life 2: Deathmatch
66.151.244.149:27016 => CONNECT

Last edited by scorpius2k1; 05-19-2020 at 13:43.
scorpius2k1 is offline
NotApollyon093
Junior Member
Join Date: Mar 2019
Location: Spokane, WA
Old 07-10-2020 , 23:34   Re: [HL2DM] Check if a player is using a health charger
Reply With Quote #2

It's possible to edit suit charger outputs to trigger something by using "ent_fire item_suitcharger addoutput OnPlayerUse:whateveryouwanttotrigger:Trigger: 0:0:-1" or something. See https://developer.valvesoftware.com/wiki/AddOutput for details.

I use this mysterious plugin where I have no idea of it's origin which is attached. Use sm_entfire instead of ent_fire since ent_fire doesn't work on non-dedicated servers.

I have no idea how to execute sourcemod scripts and whatnot from addoutput, but hope this helps.

Just an idea. I know you can do addoutput commands in SourcePawn
Attached Files
File Type: smx sm_entfire.smx (4.7 KB, 48 views)

Last edited by NotApollyon093; 07-10-2020 at 23:50.
NotApollyon093 is offline
xerox8521
Senior Member
Join Date: Sep 2011
Old 08-27-2020 , 11:55   Re: [HL2DM] Check if a player is using a health charger
Reply With Quote #3

You could use HookEntityOutput with classname item_healthcharger and item_suitcharger respectivly.
Output would be OnPlayerUse and with the provided function you get the player as either caller or activator.
xerox8521 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 05:51.


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