View Single Post
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 08-19-2009 , 02:58   Re: Block Wallhack
Reply With Quote #7

Quote:
Originally Posted by SchlumPF* View Post
found two things you really should optimize :/
anyway, as long as you do not detect whether a player can see another one more accurately this plugin is worthless + did you check whether this plugin really blocks wallhacks? i doubt that it will block all hacks since there should be more than just 1 way of creating a wallhack

PHP Code:
// fail, pev_flags can only change during player think which makes caching this one in prethink much better that this...
// NEVER USE ADDTOFULLPACK WITHOUT CACHING AS MUCH DATA AS POSSIBLE!!!
if ( pev(entpev_flags) & FL_DUCKING )

// --------------------------

// fail again, creating a new var over and over again in your plugin? you should modify
// stocks you use since most only use variables initialized by "new", in this case you should use
// a static variable
new Float:fraction
I tested it on a wallhack and it works. Even if user crouches. Will optimize these parts. I did it fast because I was tired.

Quote:
Originally Posted by ConnorMcLeod View Post
You could use ExecuteHam(Ham_FVecVisible, this, const Float: origin[3]), then you wouldn't have to retrieve player eyes position.

Code:
BOOL CBaseEntity :: FVisible ( const Vector &vecOrigin )
{
	TraceResult tr;
	Vector		vecLookerOrigin;
	
	vecLookerOrigin = EyePosition();//look through the caller's 'eyes'

	UTIL_TraceLine(vecLookerOrigin, vecOrigin, ignore_monsters, ignore_glass, ENT(pev)/*pentIgnore*/, &tr);
	
	if (tr.flFraction != 1.0)
	{
		return FALSE;// Line of sight is not established
	}
	else
	{
		return TRUE;// line of sight is valid.
	}
}
Ok, will do!

Quote:
Originally Posted by joaquimandrade View Post
I had this idea also (and I think that it has also implemented in HLGuard) and the true is: it is almost impossible to make it right without a huge amount of calculations and probably that will make it laggy with many users. One particular point where calculations are missing is in checking if the player carried weapon is visible (what is out of the player's bounding box). That will easily damage the game. And, as Exolent said particular, entities or map, designs can make it behave bad.

Edit: I have an simple idea to you. Instead of shipping it as an anti-wallhack solution, you could make it usable when you perform an action. Example: you suspect that a player is cheating, enable it on him, and check if his performance hugely differs.

One thing about the code: In traceline you should "IGNORE_GLASS".
Will see about that.

Edit: joaquimandrade thought about what you said and I won't do it unfortunately, that way it will stress up the admins too much, by leaving it the way it is it's light, and it does its job.
Made all the updates and made a small demonstration movie.
http://www.youtube.com/watch?v=jR6Nq4sj7BA
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.

Last edited by ot_207; 08-19-2009 at 04:29.
ot_207 is offline