Raised This Month: $ Target: $400
 0% 

Damage through players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KCE
Senior Member
Join Date: Jan 2005
Location: Los Angeles, CA
Old 04-10-2005 , 23:56   Damage through players
Reply With Quote #1

How do I make damage go through players?

For example, a grenade explodes. I use trace_line to see if any walls in between the players within the specified damage radius. Let's say I do a traceline for player 1 and it does damage because nothing is blocking it. Next I do a traceline for player 2 and it does not do damage because player 1 is blocking player 2.

Example : TOP-VIEW
o - player
x - grenade explosion

Code:
Player #2   o - this player is not damaged since #1 is blocking view
         
Player #1   o - nothing in view so do damage
            |  - traceline
            x
__________________

My 3D Art: http://k-c-e.deviantart.com/

[img]http://img213.**************/img213/7132/userbar152416mp2.gif[/img]
[img]http://img65.**************/img65/5606/userbar152433ie5.gif[/img]
[img]http://img223.**************/img223/7576/userbar152440yk6.gif[/img]
KCE is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 04-11-2005 , 10:40  
Reply With Quote #2

radius_damage function.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-11-2005 , 16:45  
Reply With Quote #3

radius_damage does damage through walls. He doesn't want damage to be done through walls, which is why he is using traceline. However, he wants traceline to ignore other players so that player 1 can get hurt even if he is behind player 2, and the grenade is in front of player 2.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 04-11-2005 , 16:55  
Reply With Quote #4

Then trace_line, get the player it hit, then shoot trace_line again with the player hit's ID in the "ignore" arguement of trace_line.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
KCE
Senior Member
Join Date: Jan 2005
Location: Los Angeles, CA
Old 04-11-2005 , 17:17  
Reply With Quote #5

What exactly does the "IgnoreEnt" paramter do? I thought it ignored any ent like you set it to 1 to ignore 0 not to, but I guess not. So it ignores the ent specified in the "IgnoreEnt" paramter? So what if there is a 0 for the paramater? If it only ignores the ent specified, how do you make it ignore all the players?

So would this trace through players?

Code:
//loc is the origin of the second ent and idPoint is the beggining ent stock UTIL_TraceThroughPlayers(idPoint,Float:loc[3]) {     new Float:endorigin[3]     new Float:origin[3]     new Float:blah[3]     endorigin[0]=loc[0]     endorigin[1]=loc[1]     endorigin[2]=loc[2]     pev(idPoint,pev_origin,origin)     engfunc(EngFunc_TraceLine,origin,endorigin,1,-1)     traceresult(TR_EndPos,blah)     if (blah[0] == endorigin[0] && blah[1] == endorigin[1] && blah[2] == endorigin[2])         return 1             return 0 }
__________________

My 3D Art: http://k-c-e.deviantart.com/

[img]http://img213.**************/img213/7132/userbar152416mp2.gif[/img]
[img]http://img65.**************/img65/5606/userbar152433ie5.gif[/img]
[img]http://img223.**************/img223/7576/userbar152440yk6.gif[/img]
KCE is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 04-13-2005 , 09:52  
Reply With Quote #6

the ignore entity param can be used to ignore a specific entity.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
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 10:01.


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