vehicle facing angle
#1

how can i make simsort of setvehiclefacingagle?
like setplayerfacingangle
i cant find it on sa-mp wiki
and i dont want setvehicleZangle
Reply
#2

zangle = ex: /flip rotation i dont want it
Reply
#3

the ZAngle is the SAME as the FACING ANGLE!

it is just used for /flip as if you change the position of a vehicle it flips it around automatically... and as
Code:
new Float:x, Float:y, Float:z;
GetVehiclePos(vehicleid, x, y, z);
SetVehiclePos(vehicleid, x, y, z);
would stop the speed, everyone uses the facing angle of the vehicle.
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)