02.11.2010, 21:08
(
Last edited by boelie; 02/11/2010 at 09:08 PM.
Reason: type mistake
)
Sascha is correct check these 2 differences;
The part where in the angle should be checked is GetVehicleZAngle(vehicleid,a);
for the vehicle and GetPlayerFacingAngle for player.
Just try it out and you'll see
Code:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
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));
}
GetXYInFrontOfVehicle(vehicleid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetVehiclePos(vehicleid,x,y,a);
GetVehicleZAngle(vehicleid,a);
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
for the vehicle and GetPlayerFacingAngle for player.
Just try it out and you'll see

