PDA

View Full Version : Move object in one direction from my position


Flokx
07/01/2015, 12:18 AM
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.

Flokx
07/01/2015, 06:46 PM
Bump _--__-__-__-__D -d_D_D-D-asdka;sld;

ball
08/01/2015, 12:39 PM
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).

lwilson
08/01/2015, 01:19 PM
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/