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

TraceHull Nades


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 02-07-2008 , 21:44   TraceHull Nades
Reply With Quote #1

Hey, Ive been playing with TraceLine and TraceHull. Now I know knifes are TraceHull. Nades, wtf? I can't get them to work with eathier one. How do they work? Setting them set_tr2(trace, TR_pHit, hit) doesn't work anything and setting the Friction doesn't work against nades. Any ideas?

Thanks
Styles is offline
Send a message via AIM to Styles
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-07-2008 , 22:34   Re: TraceHull Nades
Reply With Quote #2

client_damage()?

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 02-07-2008 , 23:31   Re: TraceHull Nades
Reply With Quote #3

errr...not what I'm looking for. I want do traceline/tracehull the nade damage back to the person. I know I can use Ham and block it then just take their life but I want to know ifi ts possible with TraceHull/TraceLine
Styles is offline
Send a message via AIM to Styles
Nomexous
Member
Join Date: Oct 2007
Old 02-07-2008 , 23:47   Re: TraceHull Nades
Reply With Quote #4

Nades don't deal damage by traceline or tracehull. They call FindEntityInSphere to find targets, with a radius of 350 units (CS only).
Nomexous is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 02-08-2008 , 00:01   Re: TraceHull Nades
Reply With Quote #5

Err, okay, so how would you do a "traceline" like damage event? Hook client_damage FindEntityInSphere then do w/e subtract life ect?
Styles is offline
Send a message via AIM to Styles
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 02-08-2008 , 03:38   Re: TraceHull Nades
Reply With Quote #6

You Findentinsphere and for each ent you find, give them damage. Use Ham's TakeDamage; it works best and is the most modern way.

Besides, how would you get_tr2() for pHit for more than one target?
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Nomexous
Member
Join Date: Oct 2007
Old 02-08-2008 , 10:38   Re: TraceHull Nades
Reply With Quote #7

Keep in mind that TraceLine/TraceHull/FindEntityInSphere don't deal damage. They merely provide the mod with a target to deal damage to. The mod will decide what damage to deal, if any at all. For example, tracelines are fired from the player constantly, but damage is only dealt if the player is firing. For grenades, hooking FM_FindEntityInSphere is pretty useless because only the origin and radius are passed. You can't tell which ent is calling the function. Plus, it needs to be looped, so you can't tell whether or not it's already hit another target. Wilson is right; use Ham_TakeDamage.
PHP Code:
#include <amxmodx>
#include <hamsandwich>

public plugin_init()
{
     
register_plugin("Grenade Damage example""1.0""Nomexous")
     
RegisterHam(Ham_TakeDamage"player""player_hurt")
}

public 
player_hurt(playerinflictorattackerFloat:damagedamagebits)
{
     
// We need differentiate gun damage from grenade damage.
     // We know for grenade damage, inflictor (the grenade's entity index) will not the the same as attacker (grenade's owner), so:
     
if (inflictor == attacker) return HAM_IGNORED

     
// You can alter the damage dealt. In this case, I doubled the damage dealt. This is very convenient, and not hackish at all.
     // Do your own checks here. The variable "player" is the person being hit by the damage.
     
SetHamParamFloat(4damage 2.0)
     return 
HAM_HANDLED

I haven't tested this code snippet, but it should work. I think that you really should check damagebits to determine whether or not the damage was done by a grenade, but apparently in CS DMG_BLAST is not set for grenade damage, which I think is counter-intuitive.
Nomexous is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 02-08-2008 , 19:19   Re: TraceHull Nades
Reply With Quote #8

Okay thanks.
Styles is offline
Send a message via AIM to Styles
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 22:01.


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