13.08.2010, 11:02
This topic should help it works for me for placing objects you would just need to edit to what you need ie, just return co-ords not create object.
Here is the code posted by simon in that topic.
Its camera angle that effects it though not aiming.
Here is the code posted by simon in that topic.
pawn Код:
new
Float:fPX, Float:fPY, Float:fPZ,
Float:fVX, Float:fVY, Float:fVZ,
Float:object_x, Float:object_y, Float:object_z;
// Change this constant to the the scale you want. A larger scale increases the distance from
// the camera. A negative scale will inverse the vectors and make them face in the opposite
// direction (i.e. behind the camera)
const
Float:fScale = 6.0;
GetPlayerCameraPos(playerid, fPX, fPY, fPZ);
GetPlayerCameraFrontVector(playerid, fVX, fVY, fVZ);
object_x = fPX + floatmul(fVX, fScale);
object_y = fPY + floatmul(fVY, fScale);
object_z = fPZ + floatmul(fVZ, fScale);
CreateObject(345, object_x, object_y, object_z, 0.0, 0.0, 0.0);