How to get coordinates of point to the right of vehicle?
#7

Here an easy stock

pawn Код:
stock GetXYInDirection(& Float: X, & Float: Y, Float: Angle, Float: distance = 1.0) {
    X -= (floatsin(Angle, degrees) * distance);
    Y += (floatcos(Angle, degrees) * distance);
}
And how to use it in your example

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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)