Vehicle In front of Vehicle
#3

I'm guessing this.would work:
pawn Код:
stock IsVehicleFacingVehicle(vehicleone, vehicletwo)
{
    new Float:angle1, Float:angle2;
    GetVehicleZAngle(vehicleone, angle1);
    GetVehicleZAngle(vehicletwo, angle2);
    if(angle1 > angle2)
    {
        if((angle1 - angle2) > 175 && (angle1 - angle2) < 185) return 1;
    }
    else
    {
        if((angle2 - angle1) > 175 && (angle2 - angle1) < 185) return 1;
    }
    return 0;
}
I'm sorry I you get any errors, I'm trying to script this on my phone. This took me like 20 minutes. xD

Edit: Also you could add a distance.check between the vehicles if.necessary.
Reply


Messages In This Thread
Vehicle In front of Vehicle - by Glad2BeHere - 30.01.2013, 13:04
AW: Vehicle In front of Vehicle - by Kwashiorkor - 30.01.2013, 13:29
Re: Vehicle In front of Vehicle - by Threshold - 30.01.2013, 13:33

Forum Jump:


Users browsing this thread: 1 Guest(s)