30.04.2011, 17:25
GetVehiclePos(id, x, y, z);
GetXYInFrontOfVehicle(playerid, x, y, 1.4249);
ok if a vehicle is facing like > 350 && < 360 and > 0 && < 10 it works fine, but when a vehicle turns, or is facing left or right, the offset is bad?
GetXYInFrontOfVehicle(playerid, x, y, 1.4249);
ok if a vehicle is facing like > 350 && < 360 and > 0 && < 10 it works fine, but when a vehicle turns, or is facing left or right, the offset is bad?
pawn Код:
stock GetXYInFrontOfVehicle(vehicleid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetVehiclePos(vehicleid, x, y, a);
GetVehicleZAngle(vehicleid, a);
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}