add: helper.cpp

This commit is contained in:
ALittlePatate
2022-10-01 19:58:37 +02:00
parent a61b2eb18c
commit 5af2f3169c
5 changed files with 31 additions and 2 deletions

View File

@@ -8,9 +8,11 @@
#include "../Features/Misc/Misc.hpp" #include "../Features/Misc/Misc.hpp"
void OnUpdate() { void OnUpdate() {
if (settings::spoof_level) { if (settings::spoof_level) {
Misc::SetRank(settings::new_level); Misc::SetRank(settings::new_level);
} }
if (settings::walk_in_lobby) {
Misc::WalkInlobby(settings::walk_in_lobby);
}
} }

View File

@@ -2,4 +2,16 @@
void Misc::SetRank(int rank) { void Misc::SetRank(int rank) {
Players::LocalPlayer->GetComponent("NolanRankController")->CallMethodSafe<void*>("SetRank", rank); Players::LocalPlayer->GetComponent("NolanRankController")->CallMethodSafe<void*>("SetRank", rank);
}
void Misc::WalkInlobby(bool walk) {
Unity::CComponent* UltimateCharacterLocomotionHandler = Players::LocalPlayer->GetComponent("UltimateCharacterLocomotionHandler");
if (UltimateCharacterLocomotionHandler == NULL)
{
Players::LocalPlayer->AddComponent(IL2CPP::Class::GetSystemType("UltimateCharacterLocomotionHandler"));
Players::LocalPlayer->GetComponent("UltimateCharacterLocomotionHandler")->SetMemberValue<bool>("enabled", false);
}
Players::LocalPlayer->GetComponent("UltimateCharacterLocomotionHandler")->SetMemberValue<bool>("enabled", walk);
} }

View File

@@ -6,6 +6,6 @@
#include <iostream> #include <iostream>
namespace Misc { namespace Misc {
void SetRank(int rank); void SetRank(int rank);
void WalkInlobby(bool walk);
} }

View File

@@ -0,0 +1,3 @@
#include "Helpers.hpp"
//define functions the same as in misc.hpp/cpp

View File

@@ -0,0 +1,12 @@
#pragma once
#include "../Dependencies/IL2CPP_Resolver/il2cpp_resolver.hpp"
#include "../../Utils/Players/Players.hpp"
#include "../../Utils/Settings/Settings.hpp"
#include <iostream>
//define functions the same as in misc.hpp/cpp
namespace Helpers {
}