How to set up a dino imprinted player?

Advertisement

Official Game Server Partner

Foppa

Moderator
Staff member
Messages
724
Likes
68
Points
28
Website
foppasgaming.com
I have added that in Extended RCON. So you can change imprinted player
or you can use: https://ark.gamepedia.com/Console_Commands#SetImprintedPlayer

C++:
void SetImprintToPlayer(RCONClientConnection* rcon_connection, RCONPacket* rcon_packet, UWorld*)
{
    FString msg = rcon_packet->Body;

    TArray<FString> parsed;
    msg.ParseIntoArray(parsed, L" ", true);

    if (parsed.IsValidIndex(3))
    {
        int dino_id1;
        int dino_id2;
        uint64 steam_id;       
        try
        {
            dino_id1 = std::stoi(*parsed[1]);
            dino_id2 = std::stoi(*parsed[2]);
            steam_id = std::stoull(*parsed[3]);       
        }
        catch (const std::exception&)
        {
            SendRconReply(rcon_connection, rcon_packet->Id, "Request has failed");
            return;
        }

        APrimalDinoCharacter* dino = APrimalDinoCharacter::FindDinoWithID(ArkApi::GetApiUtils().GetWorld(), dino_id1,
            dino_id2);
        if (!dino)
        {
            SendRconReply(rcon_connection, rcon_packet->Id, "Can't find dino");
            return;
        }
        AShooterPlayerController* shooter_pc = ArkApi::GetApiUtils().FindPlayerFromSteamId(steam_id);
        if (!shooter_pc)
        {

            SendRconReply(rcon_connection, rcon_packet->Id, "Can't find player from the given steam id");
            return;
        }
        FString playerName;
        shooter_pc->GetPlayerCharacterName(&playerName);
        dino->UpdateImprintingDetails(&playerName, shooter_pc->LinkedPlayerIDField());

        SendRconReply(rcon_connection, rcon_packet->Id, "Successfully changed Imprint on dino");
    }
    else
    {
        SendRconReply(rcon_connection, rcon_packet->Id, "Not enough arguments");
    }
}
 
Last edited:
Top