28.03.2013, 17:07
GetPlayerCameraLookAt
Return's X, Y, Z pos.
If you found any bug, please report.
pawn Код:
stock GetPlayerCameraLookAt(playerid, &Float:X, &Float:Y, &Float:Z)
{
new Float:pos[6];
GetPlayerCameraPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerCameraFrontVector(playerid, pos[3], pos[4], pos[5]);
X = floatadd(pos[0], pos[3]);
Y = floatadd(pos[1], pos[4]);
Z = floatadd(pos[2], pos[5]);
return 1;
}
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerCameraPos(playerid, x, y, z);
printf("%f, %f, %f", x, y, z);
GetPlayerCameraLookAt(playerid, x, y, z);
printf("%f, %f, %f", x, y, z);