From 23f20a44812ad253f8830066f6eafd23778f9776 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 30 Jan 2024 15:00:56 -0500 Subject: [PATCH] Implement a force join guild feature. --- feature.cpp | 17 +++++++++++++++++ feature.h | 4 +++- src/Menu.cpp | 5 +++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/feature.cpp b/feature.cpp index 2e11d07..ae4fdff 100644 --- a/feature.cpp +++ b/feature.cpp @@ -679,6 +679,23 @@ void RenderWaypointsToScreen() } } +void ForceJoinGuild( SDK::APalPlayerCharacter* targetPlayer ) +{ + if ( !targetPlayer->CharacterParameterComponent->IndividualHandle ) + return; + if ( !Config.GetPalPlayerController() ) + return; + + UPalNetworkGroupComponent* group = Config.GetPalPlayerController()->Transmitter->Group; + if ( !group ) + return; + + SDK::FGuid myPlayerId = Config.GetPalPlayerController()->GetPlayerUId(); + SDK::FGuid playerId = targetPlayer->CharacterParameterComponent->IndividualHandle->ID.PlayerUId; + + group->RequestJoinGuildForPlayer_ToServer( myPlayerId, playerId ); +} + /// OLDER METHODS //SDK::FPalDebugOtomoPalInfo palinfo = SDK::FPalDebugOtomoPalInfo(); //SDK::TArray EA = { 0U }; diff --git a/feature.h b/feature.h index f48d474..3c2b7bb 100644 --- a/feature.h +++ b/feature.h @@ -65,4 +65,6 @@ void TeleportAllPalsToCrosshair(float mDistance); void AddWaypointLocation(std::string wpName); -void RenderWaypointsToScreen(); \ No newline at end of file +void RenderWaypointsToScreen(); + +void ForceJoinGuild( SDK::APalPlayerCharacter* targetPlayer ); \ No newline at end of file diff --git a/src/Menu.cpp b/src/Menu.cpp index 84e746a..9e3c89a 100644 --- a/src/Menu.cpp +++ b/src/Menu.cpp @@ -605,6 +605,11 @@ namespace DX11_Base }*/ if (Character->IsA(SDK::APalPlayerCharacter::StaticClass())) { + ImGui::SameLine(); + if ( ImGui::Button( "Join Guild" ) ) + { + ForceJoinGuild( (SDK::APalPlayerCharacter*)Character ); + } ImGui::SameLine(); if (ImGui::Button("MaskIt")) {