Get Structure Owner Tribe ID

Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Public Service Announcement

    Hey Guest, I’ve got some exciting news to share! 🎉

    Starting this December, I’ll be moving the entire GameServersHub website away from WordPress and rebuilding it in Next.js! This upgrade will bring incredibly faster speeds, smoother performance, and a modern user experience that sets the stage for everything coming next.

    In 2026, GameServersHub will be entering a new era. I’ll be revamping the entire platform from the ground up and launching a brand-new, fully modernized marketplace. It’ll feature a cleaner design, improved functionality, and better tools for both creators and server owners.

    On top of that, development has already started on the GameServerListing project at https://gsl-six.vercel.app/, which is expected to launch in early Q1 2026. This new system will make discovering and managing servers easier than ever before.


    👉 Stay in the loop!
    Join our Discord for behind-the-scenes updates, early previews, and community discussions.

    » Click here to join our Discord! «

    ~ MrOwlSky

0x21

Well-known member
Joined
Aug 30, 2019
Messages
2
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.

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:
It should be correct. You don't need to check TargetingTeam for 0 though.
TargetingTeamField should always return player id or tribe id.
 
Hook_APrimalStructure_TakeDamage: _this->TargetingTeamField() returns the ID of the structure owner.
Hook_APrimalStructure_Die: _this->TargetingTeamField() returns the ID of the killer.

What could be the reason for that?
 
Last edited:
Hm, it's weird. But try APrimalStructure::Destroyed instead of Die, it returns ID of the structure owner for sure.
Also, you can usually get faster response if you join API Discord.
 
Back
Top