04.08.2014, 14:28
I need help Please.
I need X,Y and Z.
I have X Y Z of green Car
Assume that coordinate for green car is X1, Y1 and Z1
So what will the possible coordinates of Brown car.
stock GetXYFromAngle(Float: angle, Float:distance, & Float: x, & Float: y) {
x = (distance * floatsin(angle, degrees));
y += (distance * floatcos(angle, degrees));
}
//new Float:x, Float:y, Float:z, Float:rot; // is Vehicle 1 position and rotation
new Float:cx, Float:cy, Float:cz; // is Vehicle 2 position
cx = x + floatsin(360.0  (rot + 180.0), degrees) * distance_between_vehicles; // "360.0 " is to transform the samp angle to the mathematical one
cy = y + floatcos(360.0  (rot + 180.0), degrees) * distance_between_vehicles; // "+ 180.0" is to point behind the other vehicle, else it would spawn in front of it
Thats trigonometry. Im not sure about the exact angles as SAMP angles always behave strange.
pawn Код:
