diff options
author | BDKPlayer <fabian.stotz@yahoo.de> | 2020-04-10 17:54:48 +0200 |
---|---|---|
committer | BDKPlayer <fabian.stotz@yahoo.de> | 2020-04-10 17:54:48 +0200 |
commit | 8fc311eaba0bc23a2b4cfbbd7882d2385710e234 (patch) | |
tree | e2e59e86f4dea000b71746042915321943fe952c /Engine.cpp | |
parent | 5b7e11032b3e3870c3f5919e0d65927e95bbb31b (diff) |
Added Config system to save/load settings
Diffstat (limited to 'Engine.cpp')
-rw-r--r-- | Engine.cpp | 48 |
1 files changed, 43 insertions, 5 deletions
@@ -128,24 +128,53 @@ ImVec4 Engine::GetPlayerColorImGUI(int colorIndex) const return color; } +Player* Engine::GetPlayer(int index) const +{ + const int totalPlayers = GetTotalPlayers(); + if (index > totalPlayers) + { + return nullptr; + } + + MainScreen* mainScreen = GetMainScreen(); + if (!mainScreen) + { + return nullptr; + } + + World* main = GetWorld(); + if (!main) + { + return nullptr; + } + + PlayerArray* playerArray = main->pPlayerArray; + if (!playerArray) + { + return nullptr; + } + + return playerArray->playerData[index].player; +} + Player* Engine::GetPlayerByName(char* playerName) const { MainScreen* mainScreen = GetMainScreen(); if (!mainScreen) { - return NULL; + return nullptr; } World* main = GetWorld(); if (!main) { - return NULL; + return nullptr; } PlayerArray* playerArray = main->pPlayerArray; if (!playerArray) { - return NULL; + return nullptr; } int totalPlayers = GetTotalPlayers(); @@ -161,7 +190,7 @@ Player* Engine::GetPlayerByName(char* playerName) const return player; } } - return NULL; + return nullptr; } Player* Engine::GetLocalPlayer() const @@ -214,4 +243,13 @@ void Engine::PrintBottomNotification(const char* message, unsigned int hexcolor) typedef void(__fastcall* tPrintBottomText) (GameScreen* AVGameScreen, const char* message, unsigned int hexcolor, int64_t unused); static tPrintBottomText fPrintBottomText = (tPrintBottomText)(base + Offsets::printBottomText); fPrintBottomText(GetMainScreen()->pGameScreen, message, hexcolor, 0xffffffffffffffff); //Color format: RBGA -}
\ No newline at end of file +} + +int64_t Engine::Flare(float xPos, float yPos) const +{ + typedef __int64(__fastcall* tCreateFlare) (Player* player, __int64 hundert12, __int64 zero1, __int64 zero2, float xPos, float yPos, int64_t zero3, int64_t zero4); + static tCreateFlare fCreateFlare = (tCreateFlare)(base + 0xc31270); + + return fCreateFlare(GetLocalPlayer(), 0x112, 0, 0, 220.f, 220.f, 0, 0); + //__usercall fhsCreateFlare_MAYBE_7FF718CF1270@<rax>( __int64 a3_zero@<r8>, __int64 a4_zero@<r9>, float xPos@<xmm2>, float yPos@<xmm3>, __int64 a5_zero, int a6_Zero) +} |