Move object in one direction from my position
#1

I am in a Bullet(Vehicle) and I added an object on that vehicle. Now I wan't the object to move right font of the car with a command /notoy. I have tried a lot for this but my object moves other way. Please help with this.
Reply
#2

Bump _--__-__-__-__D -d_D_D-D-asdka;sld;
Reply
#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
#4

Does the Object Attached to Vehicle?? if not maybe you used it on wrong BONE.

__________________
Next Life Roleplay [Refunding/Hiring]
SERVER IP: 172.245.220.133:7108
http://nextlife-rp.boards.net/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)