05.07.2015, 19:41
pawn Код:
GetXYBehindPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
GetPlayerFacingAngle(playerid, a);
if(IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
x -= (distance * floatsin(-a, degrees));
y -= (distance * floatcos(-a, degrees));
return 1;
}
pawn Код:
GetXYBehindPlayer(target, x, y, 2.0);
SetPlayerPos(playerid, x, y, z);