/* SetPosInFrontOfPlayer INCLUDE
*
* (c) Copyright 2013, Thugman.
* Written by Thugman
*
*/
/*
FUNCTION:
SetPosInFrontOfPlayer(playerid, giveplayerid, Float:distance);
*/
SetPosInFrontOfPlayer(playerid, giveplayerid, 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));
SetPlayerPos(giveplayerid,x,y,z);
SetPlayerFacingAngle(giveplayerid,a);
}
LyogU2V0UG9zSW5Gcm9udE9mUGxheWVyIElOQ0xVREUKICoKICogKGMpIENvcHlyaWdodCAyMDEzLCBUaHVnbWFuLgogKiBXcml0dGVuIGJ5IFRodWdtYW4KICoKICovCgovKgogRlVOQ1RJT046CiBTZXRQb3NJbkZyb250T2ZQbGF5ZXIocGxheWVyaWQsIGdpdmVwbGF5ZXJpZCwgRmxvYXQ6ZGlzdGFuY2UpOwoqLwoKU2V0UG9zSW5Gcm9udE9mUGxheWVyKHBsYXllcmlkLCBnaXZlcGxheWVyaWQsIEZsb2F0OmRpc3RhbmNlKQp7CiAgICBuZXcgRmxvYXQ6eCxGbG9hdDp5LEZsb2F0OnosRmxvYXQ6YTsKICAgIEdldFBsYXllclBvcyhwbGF5ZXJpZCwgeCwgeSx6KTsKICAgIEdldFBsYXllckZhY2luZ0FuZ2xlKHBsYXllcmlkLCBhKTsKICAgIHggKz0gKGRpc3RhbmNlICogZmxvYXRzaW4oLWEsIGRlZ3JlZXMpKTsKICAgIHkgKz0gKGRpc3RhbmNlICogZmxvYXRjb3MoLWEsIGRlZ3JlZXMpKTsKICAgIFNldFBsYXllclBvcyhnaXZlcGxheWVyaWQseCx5LHopOwoJU2V0UGxheWVyRmFjaW5nQW5nbGUoZ2l2ZXBsYXllcmlkLGEpOwp9