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

Amplify damage taken from trigger_hurt


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 06-22-2014 , 13:25   Amplify damage taken from trigger_hurt
Reply With Quote #1

I can't find damage type trigger_hurt in the hlsdk_const.ini. Please help me detect the trigger_hurt damage.

Code:
#include <amxmodx> #include <hamsandwich> public plugin_init() {     register_plugin("D7 Damage Amplifier Trigger Hurt", "0.0.1", "D i 5 7 i n c T")         RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage") } public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) {     if (damage >= 100.0 && /* DETECT TRIGGER_HURT DAMAGE */)     {         damage *= 500.0                 SetHamParamFloat(4, damage)     } }
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 06-22-2014 , 13:41   Re: Amplify damage taken from trigger_hurt
Reply With Quote #2

PHP Code:
(dmgbits DMG_GENERIC
?
That's the only thing on my mind right now, will se anywhere to help!
EDIT: I think that this thread, and mostly ConnorMcLeod's reply, will help you.
https://forums.alliedmods.net/showthread.php?t=94221
__________________

Last edited by Flick3rR; 06-22-2014 at 13:41.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 06-22-2014 , 14:35   Re: Amplify damage taken from trigger_hurt
Reply With Quote #3

Trigger_hurt can have different damage types.
I see 2 ways to do this.

#1
PHP Code:
if( attacker 32 || is_valid_entity(attacker) || pevattackerpev_solid ) == SOLID_TRIGGER )
{
// trigger_hurt or ohter entity what did damage and have solid_trigger
// ps: only costom entities can be that way

#2
Ohter way is to find all trigger_hurts in plugin_init and set they for example pev_iuser to something and then check it.
.Dare Devil. is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 06-22-2014 , 14:38   Re: Amplify damage taken from trigger_hurt
Reply With Quote #4

Why not check inflictors classname? I don't know, but it might work.
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness
GuskiS is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 06-22-2014 , 14:44   Re: Amplify damage taken from trigger_hurt
Reply With Quote #5

Quote:
Originally Posted by GuskiS View Post
Why not check inflictors classname? I don't know, but it might work.
Checking the strings in takedamage is bad thing.
You should avoid checking strings on fast called functions.
.Dare Devil. is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 06-22-2014 , 16:32   Re: Amplify damage taken from trigger_hurt
Reply With Quote #6

If he is checking damage >= 100.0 then that string check wouldn't be called that often cause I doubt that there are many things that can cause such damage in one tick/frame
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness

Last edited by GuskiS; 06-22-2014 at 16:32.
GuskiS 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 13:38.


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