/* 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);
}