05.10.2010, 14:15
Ah, got it:
You compare the calculated point to the vehicle pos, not the fire pos. Replace the x1,y1,z1 in the upper line by x2,y2,z2 (and do <= 5.0 or 10.0 as well)
pawn Код:
GetVehiclePos(GetPlayerVehicleID(playerid), x1, y1, z1);
//...
dX = cPosX + floatmul(cX, Dist);
dY = cPosY + floatmul(cY, Dist);
dZ = cPosZ + floatmul(cZ, Dist);
if(GetDistanceBetweenPoints(x1, y1, z1, dX, dY, dZ) <= 50.0)