mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 19:02:21 +01:00
Fixed MCP on 1.8, Fixed some buildings not showing up on 1.7.2 and 1.8, fixed listplayers crashing on some versions
31 lines
745 B
C++
31 lines
745 B
C++
#include "PlayerState.h"
|
|
|
|
#include "reboot.h"
|
|
|
|
FString APlayerState::GetPlayerName()
|
|
{
|
|
static auto GetPlayerNameFn = FindObject<UFunction>("/Script/Engine.PlayerState.GetPlayerName");
|
|
|
|
if (GetPlayerNameFn)
|
|
{
|
|
FString PlayerName;
|
|
this->ProcessEvent(GetPlayerNameFn, &PlayerName);
|
|
return PlayerName;
|
|
}
|
|
|
|
static auto PlayerNameOffset = GetOffset("PlayerName");
|
|
return Get<FString>(PlayerNameOffset);
|
|
}
|
|
|
|
int& APlayerState::GetPlayerID()
|
|
{
|
|
static auto PlayerIDOffset = FindOffsetStruct("/Script/Engine.PlayerState", "PlayerID", false);
|
|
|
|
if (PlayerIDOffset == -1)
|
|
{
|
|
static auto PlayerIdOffset = FindOffsetStruct("/Script/Engine.PlayerState", "PlayerId", false);
|
|
return Get<int>(PlayerIdOffset);
|
|
}
|
|
|
|
return Get<int>(PlayerIDOffset);
|
|
} |