Block knife attack
Hi,
To make someone invulnerable for some players , i see that there are two methods : - Traceline - Set_user_hitzones Nevertheless, I Have one problem, people aren't protect against knife or nade attacks. Is there a mean to block damage done by some players with knife or nades ??? Tks U |
Re: Block knife attack
After a search, one solution to this problem seems to be trace_hull. People tells that this function is adapted but I don't find example of its use.
Somebody can tell me (knows) how use this function (trace_hull) to solve my problem ? Tks :) |
Re: Block knife attack
Override TraceLine function with register_forward().
Here is an example from AXN how to disable a HEADSHOT. Code:
void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) |
Re: Block knife attack
Maybe I'm stupid but i don't understand what u say. Your code isn't a Pawn Code ??
I try to block knife attack from some people against specific others. I've read that i need to use trace_hull (because traceline isn't the solution to block melee attack) but I don't know how to use this function in my case ? I don't understand how your post answer to this ? Can u explain please ? Thank you |
Re: Block knife attack
It's a C++. Right now I have no time to explain. I just gave you a main idea. Thought you'll get it.
|
Re: Block knife attack
Quote:
|
Re: Block knife attack
Thank you but I think that it will be hard (for me) to do something with this C++ code for a plugin ... written in Pawn.
However, someone can explain how to use trace_hull to solve my problem or if it's too long, someone can give me reference of plugins which use trace_hull ? |
Re: Block knife attack
Try something like this.
Code:
It hooks trace_hull, and if a player that should be knife immune is getting hit by it, it overrides it and says that instead, no one is getting hit by it. If you want to check the attacker, use skipEnt (but make sure it is a player). |
Re: Block knife attack
I tried this (everyone is immune) :
Code:
#include <amxmodx>I make a test : When script pass the first condition and get hit, the only hit returned is "-1". I think that it's not a value wanted. No ? Do u know why we have only -1 ? Thank u |
Re: Block knife attack
Either the trace isn't getting stored in the global trace handler, or I don't quite understand hull traces. Try changing the get_tr line to this:
Code:
|
| All times are GMT -4. The time now is 22:22. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.