add: IsInGame function

This commit is contained in:
jadis0x
2022-10-01 22:38:40 +03:00
committed by GitHub
parent 532da087f8
commit 5d56a1dcfc

View File

@@ -4,3 +4,18 @@
bool Helpers::isPlayerCrawling() {
return Players::LocalPlayer->GetComponent("NolanBehaviour")->CallMethod<bool*>("IsCrawling");
}
bool Helpers::IsInGame() {
Unity::CGameObject* OptionsHelpers = Unity::GameObject::Find("OptionsHelpers");
Unity::CComponent* OptionsHelpersData = OptionsHelpers->GetComponent("OptionsHelpers");
if (OptionsHelpers == NULL) {
return false;
}
if (OptionsHelpersData == NULL) {
return false;
}
return OptionsHelpersData->GetMemberValue<bool*>("inGame");
}