PDA

View Full Version : compare vpoint - player's looking position



feanor
17th November 2017, 09:50
start = eAttacker getRealEye();
fw = anglestoforward(self getplayerangles());
end = start + maps\mp\_utility::vectorscale( fw, 10000 );


trace = bulletTrace(start, end, true, undefined);

i am trying to fix silent aim.

its the position of player's looking isnt it ?

and vPoint variable in callbackplayerdamage is the point the player hits on the eVictim isnt it ?

but if i compare it they dont give me the same result ?(without cheat) why?

voron00
17th November 2017, 10:15
vPoint is the point of where the damage was taken, not bullet fired.

feanor
17th November 2017, 10:21
not bullet fired.
wut?

kung foo man
17th November 2017, 10:38
No clue what you are trying to do, but you take the eye pos from eAttacker, but add the forward direction of self to it. Do you mean this?



fw = anglestoforward(eAttacker getplayerangles());


And since getRealEye isn't a default function, just help people to understand your code by linking to its parts: https://github.com/kungfooman/cod2_std/blob/master/utils.gsc#L184

For debugging, you can either print the coordinates or just spawn some entities to that position

lopp1
17th November 2017, 10:53
crazybot silent aim Aimbot fov=1 Aimbot fov=2 Aimbot fov=3 that's the problem:confused:

serthy
17th November 2017, 13:17
When fixing silent aim, maybe do something like this (after you get the players eye-pos based on the current stance):


trace = bulletTrace( start , end , true , attacker );

if( !isDefined( trace["entity"] ) || !isPlayer( trace["entity"] ) || trace["entity"] != victim || distance( trace["position"] , vPoint ) > 4 )
iPrintLn( "silent aim" );

maxdamage99
17th November 2017, 14:36
If player kill enemy in VERY SUPER SPEED MOUSE :D?

feanor
17th November 2017, 17:42
No clue what you are trying to do, but you take the eye pos from eAttacker, but add the forward direction of self to it. Do you mean this?



fw = anglestoforward(eAttacker getplayerangles());


And since getRealEye isn't a default function, just help people to understand your code by linking to its parts: https://github.com/kungfooman/cod2_std/blob/master/utils.gsc#L184

For debugging, you can either print the coordinates or just spawn some entities to that position

with silent aim if player shoots (x , y , z) point , his bullets hits to (r , s , t) point. i am trying to find these points , thats what i am trying to do.

1380



check( eVictim , eInflictor , eAttacker , iDamage , iDFlags , sMeansOfDeath , sWeapon , vPoint , vDir , sHitLoc , timeOffset )
{

start = eAttacker getRealEye();
fw = anglestoforward(eAttacker getplayerangles());
end = start + maps\mp\_utility::vectorscale( fw, 10000 );


trace = bulletTrace(start, end, true, eAttacker);


if( trace["position"] == vPoint )
return false ;

iPrintln("silent aim detected");
return true;
}

getRealEye()
{
player = self;

stance = player getStance();

offset = 0;
switch (stance)
{
case "stand": offset = 20; break;
case "duck": offset = 0; break;
case "lie": offset = -30; break;
//default: offset = getcvarint("offset");
}

realEye = player getEye() + (0,0,offset);
return realEye;
}



If player kill enemy in VERY SUPER SPEED MOUSE :D?

it happens in same frame , i dont think so it will be wrong


vPoint is the point of where the damage was taken, not bullet fired.

how they cant be the same ? so there is a way to detect it ?

feanor
17th November 2017, 19:06
When fixing silent aim, maybe do something like this (after you get the players eye-pos based on the current stance):


trace = bulletTrace( start , end , true , attacker );

if( !isDefined( trace["entity"] ) || !isPlayer( trace["entity"] ) || trace["entity"] != victim || distance( trace["position"] , vPoint ) > 4 )
iPrintLn( "silent aim" );


i figured out if player hits to for example near of boots , bullettrace doesnt stop. it ends on the ground. actually eattacker hits to evictim but it is not same in bullettrace

kung foo man
17th November 2017, 19:24
You just need to get the two directional vectors, which is direction = from - to; (and normalize those two directions)

a) from getrealeye to bullet hitpoint
b) from getrealeye to getrealeye += foward * 10000

Then do iprintln(vectorDot(a, b)); and you should understand it, basically it gives you the angle between the two vectors

YouTube has enough videos which explains dot product

Made some example code for IPython, for quick testing:



import numpy as np

def veclength(vec):
return np.sqrt( dot(vec, vec) )
def dot(a, b):
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]
def scale(vec, s):
return [ vec[0]*s, vec[1]*s, vec[2]*s ]
def a_minus_b(a, b):
return [ a[0]-b[0], a[1]-b[1], a[2]-b[2] ]
def normalize(vec):
l = veclength(vec)
return [ vec[0]/l, vec[1]/l, vec[2]/l ];

player_from = [100,100,100]
player_to_a = [100,100,130]
player_to_b = [100,100,130]
player_to_c = [100,99,130]

dir_a = a_minus_b(player_to_a, player_from);
dir_b = a_minus_b(player_to_b, player_from);
dir_c = a_minus_b(player_to_c, player_from);

dir_a = normalize( dir_a )
dir_b = normalize( dir_b )
dir_c = normalize( dir_c )

print("dir_a", dir_a)
print("dir_b", dir_b)
print("dir_c", dir_c)

print("dot(dir_a, dir_b)", dot(dir_a, dir_b))
print("dot(dir_a, dir_c)", dot(dir_a, dir_c))


Output:



('dir_a', [0.0, 0.0, 1.0])
('dir_b', [0.0, 0.0, 1.0])
('dir_c', [0.0, -0.033314830232638482, 0.99944490697915433])
('dot(dir_a, dir_b)', 1.0)
('dot(dir_a, dir_c)', 0.99944490697915433)

Lonsofore
18th November 2017, 04:47
Hehe, made this anti-silent-aim about two-three weeks ago and what can I say: sometimes it can react to lag players, so use some minimal distance between that points and ban players only after few reacts (5-10 maybe). And this works for me.

Also, I made anti-simple-aim. That's what maxdamage99 already said:

If player kill enemy in VERY SUPER SPEED MOUSE :D?

Working good aswell.