Recovering my menu, function doesn't work
Hello,
I'm trying to fix my menu but if i exec this function to hook
my game crash, and if i don't exec and exec my start like this
nothing happens, and my "armor_player" always returns 0 buying or not armor
Any help is appreciated!
Thanks!
I'm trying to fix my menu but if i exec this function to hook
Code:
bool Hooking::HookNatives()
{
return true
&& Native(0x4EDE34FBADD967A6, &MY_WAIT, &ORIG_WAIT);
}
Code:
void Hooking::Start(HMODULE hmoduleDLL)
{
_hmoduleDLL = hmoduleDLL;
Log::Init(hmoduleDLL);
FindPatterns();
static int armour_player = 0;
Player player = PLAYER::PLAYER_ID();
Ped playerPed = PLAYER::PLAYER_PED_ID();
armour_player = PED::GET_PED_ARMOUR(playerPed);
DEBUGMSG("%i", armour_player);
PLAYER::SET_PLAYER_INVINCIBLE(player, true);
ENTITY::SET_ENTITY_PROOFS(playerPed, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
PED::SET_PED_CAN_RAGDOLL(playerPed, FALSE);
PED::SET_PED_CAN_RAGDOLL_FROM_PLAYER_IMPACT(playerPed, FALSE);
PED::ADD_ARMOUR_TO_PED(playerPed,
PLAYER::GET_PLAYER_MAX_ARMOUR(player) -
PED::GET_PED_ARMOUR(playerPed));
if (!InitializeHooks()) Cleanup();
while (DoUnload == false)
{
Sleep(1000);
}
Sleep(2000);
FreeLibraryAndExitThread(hmoduleDLL, 0);
}
Any help is appreciated!
Thanks!