01.05.2014, 11:07
How i can do this? Thank you for response.
GetXYInFrontOfVehicle(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetVehiclePos(playerid, x, y, a);
GetVehicleZAngle(playerid, a);
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
Here is the code for GetXYInFrontOfVehicle()
pawn Код:
|
GetXYZInFrontOfVehicle(vehicleid, &Float:x, &Float:y, &Float:z, Float:distance)
{
new Float:a;
GetVehiclePos(playerid, x, y, z);
GetVehicleZAngle(playerid, a);
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
z += 1.0;
}
Here is the code for GetXYInFrontOfVehicle()
pawn Код:
|
You need the z (height) and that can be found by GetVehiclePos function. I added + 1 to the current height just to prevent it to be underground. If it's over the ground though, you can remove it.
pawn Код:
|