14.07.2012, 14:03
As i have that problem too,
i tested that code but it doesnt change the rotation of the (attached) object:
new Float:tfx[6];
GetPlayerCameraFrontVector(playerid, tfx[0],tfx[1],tfx[2]);
SetObjectRot(gunobj, asin(tfx[2]), 0.0, 360 - atan2( tfx[0], tfx[1]));
i tested that code but it doesnt change the rotation of the (attached) object:
new Float:tfx[6];
GetPlayerCameraFrontVector(playerid, tfx[0],tfx[1],tfx[2]);
SetObjectRot(gunobj, asin(tfx[2]), 0.0, 360 - atan2( tfx[0], tfx[1]));