26.08.2011, 15:00
(
Last edited by Nero_3D; 28/08/2011 at 01:51 PM.
Reason: Changed the name of the first function
)
pawn Code:
stock RotatePoint(& Float: X, & Float: Y, & Float: Z, Float: pitch, Float: yaw, Float: distance) {
X -= (distance * floatcos(pitch, degrees) * floatsin(yaw, degrees));
Y += (distance * floatcos(pitch, degrees) * floatcos(yaw, degrees));
Z += (distance * floatsin(pitch, degrees));
}
pawn Code:
stock GetXYZOfVehicle(vehicleid, & Float: X, & Float: Y, & Float: Z, Float: pitch, Float: distance) {
static
Float: yaw;
if(GetVehicleZAngle(vehicleid, yaw)) {
GetVehiclePos(vehicleid, X, Y, Z);
RotatePoint(X, Y, Z, pitch, yaw, distance);
return true;
}
return false;
}