09-18-2011, 21:55
Can someone make a code that pushes the player in the direction he is aiming?
The player should not get pushed in the air but only the x and y axis.
This stuff might help:
setvelocity(x velocity, y velocity , z velocity)
getvelocity()
Code from 4funplaying:
You'd probably also have to do some vector math and such but that's the part of math I am the worst at so I know nothing about that.
Good luck to anyone who's going to try!
The player should not get pushed in the air but only the x and y axis.
This stuff might help:
setvelocity(x velocity, y velocity , z velocity)
getvelocity()
Code from 4funplaying:
Code:
getAim()
{
forward = self getTagOrigin("tag_eye");
end = self vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
Crosshair = BulletTrace( forward, end, true, self )[ "position" ];
return Crosshair;
}
vector_scal(vec, scale)
{
vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
return vec;
}
Good luck to anyone who's going to try!