Sascha is correct check these 2 differences;
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));
}
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