GetXYInFrontOfVehicle problem?
#1

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?

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));
}
Reply


Messages In This Thread
GetXYInFrontOfVehicle problem? - by Donya - 30.04.2011, 17:25
Re: GetXYInFrontOfVehicle problem? - by xir - 30.04.2011, 17:30
Re: GetXYInFrontOfVehicle problem? - by Donya - 30.04.2011, 17:43
Re: GetXYInFrontOfVehicle problem? - by fordawinzz - 26.12.2011, 16:47
Re: GetXYInFrontOfVehicle problem? - by jamesbond007 - 26.12.2011, 18:24

Forum Jump:


Users browsing this thread: 1 Guest(s)