30.01.2013, 13:33
I'm guessing this.would work:
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.
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;
}
Edit: Also you could add a distance.check between the vehicles if.necessary.