vehicle facing angle
#4

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
Reply


Messages In This Thread
vehicle facing angle - by dark_clown - 02.11.2010, 19:07
Re: vehicle facing angle - by dark_clown - 02.11.2010, 19:22
Re: vehicle facing angle - by Sascha - 02.11.2010, 19:45
Re: vehicle facing angle - by boelie - 02.11.2010, 21:08

Forum Jump:


Users browsing this thread: 3 Guest(s)