/* LookCameraAtPlayer INCLUDE
*
* (c) Copyright 2013, Thugman.
* Written by Thugman
*
*/
/*
FUNCTION:
LookCameraAtPlayer(playerid, Float:distance);
*/
LookCameraAtPlayer(playerid, Float:distance)
{
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid, x, y,z);
GetPlayerFacingAngle(playerid, a);
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
SetPlayerCameraPos(playerid, x, y, z);
GetPlayerPos(playerid, x, y,z);
SetPlayerCameraLookAt(playerid, x, y, z);
}
LyogTG9va0NhbWVyYUF0UGxheWVyIElOQ0xVREUKICoKICogKGMpIENvcHlyaWdodCAyMDEzLCBUaHVnbWFuLgogKiBXcml0dGVuIGJ5IFRodWdtYW4KICoKICovCgovKgogRlVOQ1RJT046CiBMb29rQ2FtZXJhQXRQbGF5ZXIocGxheWVyaWQsIEZsb2F0OmRpc3RhbmNlKTsKKi8KCkxvb2tDYW1lcmFBdFBsYXllcihwbGF5ZXJpZCwgRmxvYXQ6ZGlzdGFuY2UpCnsKICAgIG5ldyBGbG9hdDp4LEZsb2F0OnksRmxvYXQ6eixGbG9hdDphOwogICAgR2V0UGxheWVyUG9zKHBsYXllcmlkLCB4LCB5LHopOwogICAgR2V0UGxheWVyRmFjaW5nQW5nbGUocGxheWVyaWQsIGEpOwogICAgeCArPSAoZGlzdGFuY2UgKiBmbG9hdHNpbigtYSwgZGVncmVlcykpOwogICAgeSArPSAoZGlzdGFuY2UgKiBmbG9hdGNvcygtYSwgZGVncmVlcykpOwoJU2V0UGxheWVyQ2FtZXJhUG9zKHBsYXllcmlkLCB4LCB5LCB6KTsKCUdldFBsYXllclBvcyhwbGF5ZXJpZCwgeCwgeSx6KTsKICAgIFNldFBsYXllckNhbWVyYUxvb2tBdChwbGF5ZXJpZCwgeCwgeSwgeik7Cn0=