28.04.2012, 16:41
Here an easy stock
And how to use it in your example
pawn Код:
stock GetXYInDirection(& Float: X, & Float: Y, Float: Angle, Float: distance = 1.0) {
X -= (floatsin(Angle, degrees) * distance);
Y += (floatcos(Angle, degrees) * distance);
}
pawn Код:
new
Float: X,
Float: Y,
Float: Z,
Float: A
;
GetVehiclePos(vehicleid, X, Y, Z);
GetVehicleZAngle(vehicleid, A);
GetXYInDirection(X, Y, (A - 90.0), 5.0); // (angle - 90) is the angle to the right