Move object in one direction from my position
#3

Code:
stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, &Float:z, &Float:a, Float:distance)
{
	GetPlayerPos(playerid, x, y ,z);
	if(IsPlayerInAnyVehicle(playerid))
	{
		GetVehicleZAngle(GetPlayerVehicleID(playerid),a);
	}
	else
	{
		GetPlayerFacingAngle(playerid, a);
	}
	x += (distance * floatsin(-a, degrees));
	y += (distance * floatcos(-a, degrees));
	return 0;
}
Edit this function on your own. This returns x and y variable in front of player. Add to angle 90 or 270 (I don't know which amount will be good for right movement).
Reply


Messages In This Thread
Move object in one direction from my position - by Flokx - 07.01.2015, 00:18
Re: Move object in one direction from my position - by Flokx - 07.01.2015, 18:46
Re: Move object in one direction from my position - by ball - 08.01.2015, 12:39
Re: Move object in one direction from my position - by lwilson - 08.01.2015, 13:19

Forum Jump:


Users browsing this thread: 1 Guest(s)