Yes, it needs to go inside the constructor.
You probably already have a reference to the pistol actor in your class. If not, you can declare it in the header file like this:
TSubclassOf<class AActor> MyPistol;
In the constructor, you need to tell FObjectFinder what type of class to expect, in this case UBlueprint. Then spawn an actor with the found object as template. You might want to add a check to make sure the object was actually found (in case you ever change the path):
static ConstructorHelpers::FObjectFinder<UBlueprint> PistolBP(TEXT("Blueprint'/Game/FirstPersonCPP/Blueprints/Pickup/Pistol'"));
if (PistolBP)
{
MyPistol = GetWorld()->SpawnActor(PistolBP.Object->GetClass());
}
Actually, for Blueprints the path might have to look like this: Blueprint’/Game/FirstPersonCPP/Blueprints/Pickup/Pistol.Pistol’
You can also use the ClassFinder directly, which works pretty similar to the ObjectFinder:
static ConstructorHelpers::FClassFinder<UBlueprint> PistolBP(TEXT("Blueprint'/Game/FirstPersonCPP/Blueprints/Pickup/Pistol'"));
if (PistolBP)
{
MyPistol = GetWorld()->SpawnActor(PistolBP.Class);
}