Hey. How can I get the tribe ID of the destroyed structure?
This code returns the same tribe ID for the killer and the structure owner.
This code returns the same tribe ID for the killer and the structure owner.
C++:
bool Hook_APrimalStructure_Die(APrimalStructure* _this, float KillingDamage, FDamageEvent* DamageEvent, AController* Killer, AActor* DamageCauser)
{
int structureTeamId = _this->TargetingTeamField();
if (structureTeamId != 0) // tribe
{
if (Killer && Killer->IsA(APlayerController::StaticClass())) {
AShooterPlayerController* player = (AShooterPlayerController*)Killer;
int killerTeamId = player->TargetingTeamField();
ArkApi::GetApiUtils().SendChatMessage(player, "TestPlugin", *FString("[Structure Death] StructureTeamId: " + std::to_string(structureTeamId)));
ArkApi::GetApiUtils().SendChatMessage(player, "TestPlugin", *FString("[Structure Death] KillerTeamId: " + std::to_string(killerTeamId)));
}
}
}
Last edited: