Author Topic: Add Velocity  (Read 1351 times)

Yeah, I already tried that. It just kept pushing me the same way no matter what direction I was facing.

Yeah, I already tried that. It just kept pushing me the same way no matter what direction I was facing.

This works perfectly for me:

Code: [Select]
function serverCmdTestOffset(%cl,%offx,%offy,%offz)
{
%pl = %cl.player;

if(!isObject(%pl))
return;

%fv = %pl.getForwardVector();
%vx = getWord(%fv,0);
%vy = getWord(%fv,1);

%pl.addVelocity(%offx * %vy + %offy * %vx SPC %offy * %vy + %offx * -%vx SPC %offz);
}