Move a object on my body
#1

So when I am on a vehicle and my vehicle has objects. I wan't them to go right where I am facing with my car with /move cmd. I have tried and failed hardly. Please help me somehow +rep

Here:
Код:
new Float:x, Float:y, Float:z;
GetObjectPos(objectid, x, y, z);
new movetime = MoveObject(objectid, x+100, y, z, 4.00);
The object is in my position and I am in a vehicle. I want it to go right where I am facing. But it's moving randomly anywhere.
Reply
#2

Bump
Reply
#3

Try it with GetPlayerCameraPos(), get the Floats and move the Object to that values
Reply
#4

This is possibly not right, it would be something like this (you should try this):

pawn Код:
new Float:x, Float:y, Float:z, Float:VX, Float:VY, Float:A, movetime;
GetObjectPos(playerid, x, y, z); //obj pos
GetPlayerCameraFrontVector(playerid, VX, VY, A); //front vector, obviously
A = atan2(VY, VX) - 180.0; //Angle right of player's camera
movetime = MoveObject(objectid, x+floatsin(-A, degrees), y+floatcos(A, degrees), z, 4.00);
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)