Search for wall between 2 origins
I made a grenade which deals splash damage. The problem is the grenade will do damage to you even if you are on the opposite side of a wall but still in distance.
Is there a way to check to see if a wall is in between a player and the grenade? I have the origins and the distance, but not sure how to scan for a wall. |
Re: Search for wall between 2 origins
do a traceline.
|
Re: Search for wall between 2 origins
Alright thanks. This doesn't seem to be working properly for me yet.
I'm trying to return the entity index the traceline is hitting but it seems to be incorrect. PHP Code:
Also, it seems tracelines go through walls? When I run out of view of the grenade it will still display the player index or the grenade index. |
Re: Search for wall between 2 origins
Try :
Code:
where id is the index of player that have for origin playerOrg Just thought you should have a look at avalanche's "no he through walls" plugin. |
Re: Search for wall between 2 origins
I'm now thinking that the 5th argument is the entity that the traceline is bypassing. Is this correct?
I tried setting it to the players id. Now it will return -1. I also looked at Avalanche's plugin and it looked pretty much like I have my code now. Here is what I now have that is returning -1 PHP Code:
|
Re: Search for wall between 2 origins
Quote:
I also think that if you set 4th arg to DONT_IGNORE_MONSTERS, it can return another player that could be between the nade and the first player. But a wall is not often an entity, so you have to make other checks. May be compare nade origin and origin of what is returned PHP Code:
Wait for good advises of skilled coders :mrgreen: |
Re: Search for wall between 2 origins
Quote:
|
Re: Search for wall between 2 origins
Code:
stock fm_trace_line(ignoreent, const Float:start[3], const Float:end[3], Float:ret[3]) { |
Re: Search for wall between 2 origins
Thanks, working perfect now :)
|
| All times are GMT -4. The time now is 01:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.