[Help] Charging using SetPlayerVelocity
#4

This is what I've made, but it doesnt seem to work, just charges me into some random direction.
pawn Код:
new
    Float: a,
    Float: x1,
    Float: y1,
    Float: z1,
    Float: x2,
    Float: y2,
    Float: z2,
    Float: distance;

GetPlayerPos(playerid, x1, y1, z1);
GetPlayerFacingAngle(playerid, a);
GetXYInFrontOfPlayer(playerid, x2, y2, 2.0);

//distance = floatsqroot (floatpower ((x1 - x2), 2) + floatpower ((y1 - y2), 2) + floatpower ((z1 - z2), 2));

//x1 = x1 + (distance * floatsin(-a, degrees));
//y1 = y1 + (distance * floatcos(-a, degrees));

//distance = floatsqroot ((floatpower ((x1 - x2), 2)) + (floatpower ((y1 - y2), 2)));

x1 = floatsqroot( floatpower( (x1 - x2), 2) );
y1 = floatsqroot( floatpower( (y1 - y2), 2) );

//x2 = x1 + (x1 * floatsin(-a, degrees));
//y2 = y1 + (y1 * floatcos(-a, degrees));

SetPlayerVelocity(playerid, x1, y1, 0.1);
Reply


Messages In This Thread
[Help] Charging using SetPlayerVelocity - by Universal - 04.02.2012, 14:31
Re: [Help] Charging using SetPlayerVelocity - by thimo - 04.02.2012, 14:47
Re: [Help] Charging using SetPlayerVelocity - by Universal - 04.02.2012, 15:03
Re: [Help] Charging using SetPlayerVelocity - by Universal - 04.02.2012, 15:22
Re: [Help] Charging using SetPlayerVelocity - by thimo - 05.02.2012, 08:29

Forum Jump:


Users browsing this thread: 3 Guest(s)