25.08.2014, 20:17
Hello. I wanted to ask if anyone knows how to get Z coordinate in front of vehicle in specified distance?
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance) // by ******
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
GetPlayerFacingAngle(playerid, a);
if (GetPlayerVehicleID(playerid))
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
new Float:x, Float:y, Float:z;
GetVehiclePos(vehicle, x, y, z);
GetXYInFrontOfPlayer(playerid, x, y, distance);
new Float:x, Float:y, Float:z;
GetVehiclePos(vehicle, x, y, z);
GetXYInFrontOfPlayer(playerid, x, y, distance);
MapAndreas_FindZ_For2DCoord(x, y, z);