itsjustcurtis / MenyooSP

[or Menyoo PC] - Trainer/mod menu for Grand Theft Auto V (single-player).
https://www.gta5-mods.com/scripts/menyoo-2-0
GNU General Public License v3.0
44 stars 8 forks source link

DLC Vehicles despawning in latest version of the game #6

Closed itsjustcurtis closed 7 months ago

itsjustcurtis commented 7 months ago

Memory flags to prevent dlc vehicles despawning are either out-dated or incorrect for b3095.

itsjustcurtis commented 7 months ago

Need to update the native, on this site

https://alloc8or.re/gta5/nativedb/ or https://nativedb.dotindustries.dev https://gta5.nativedb.dotindustries.dev/natives

you can generate and tweak a bit? I also attach my file, it is not new but from 11/29/2023 but at least it is ready, but it is better to update everything to version 3095. Natives.zip

DLC Vehicle despawning is done via memory edits, not native functions.

As it turns out, the memory pointers are unchanged since b2802 and the function there works fine in the current version of the game.

itsjustcurtis commented 7 months ago

update GTAmemory.cpp float GeneralGlobalHax::GetPlayerHeight() { auto baddr = GeneralGlobalHax::WorldPtrPtr(); if (baddr) { auto gameVersion = GTAmemory::GetGameVersion(); if (gameVersion <= eGameVersion::VER_1_0_3095_0) //2802 2944 return (GetMultilayerPointer(baddr, std::vector{0x8, 0x88})); } return 1.0f; } void GeneralGlobalHax::SetPlayerHeight(float value) { auto baddr = GeneralGlobalHax::WorldPtrPtr(); if (baddr) { auto gameVersion = GTAmemory::GetGameVersion(); if (gameVersion <= eGameVersion::VER_1_0_3095_0) //2802 2944 (GetMultilayerPointer(baddr, std::vector{0x8, 0x88})) = value; } }

and case eGameVersion::VER_1_0_3095_0: default: GTAmemory::GetGlobalPtr(4541411) = uSure ? 1 : 0; break; GTAmemory::GetGlobalPtr(4540731) = uSure ? 1 : 0; break; GTAmemory::GetGlobalPtr(4540726) = uSure ? 1 : 0; break; //vh bypass globalHandle(4540726).As() = 1; GTAmemory::GetGlobalPtr(1669394) = uSure ? 1 : 0; break; //bypass_game globalHandle(1669394).As() = 1; *GTAmemory::GetGlobalPtr(2697019) = uSure ? 1 : 0; break; //freemode_bypass Model Spawn

GetPlayerMovementSpeed not work I don't know if the addresses have changed, I can't find the new ones if they have.

It has already been updated to the current game version. I'm not sure why you're talking about player movement speed as that has nothing to do with this issue.

If you want to make edits, please do so via the proper means; fork this repository, make the relevant changes, then send a pull request.

itsjustcurtis commented 7 months ago

Unable to be tested as new natives are incompatible with old versions of the game.

itsjustcurtis commented 7 months ago

Fix does not appear to work for some users, further investigation required.

itsjustcurtis commented 7 months ago

Its seems that some users games are using the new 4541411 pointer, and some have retained the older 4540726. No pattern found as yet, may be easiest to set both flags to true.

itsjustcurtis commented 7 months ago

@katsutosh we may need to get clever with this, looks like this breaks something in Fivem. Going to see if I can create a bypass as the function isn't really needed for fivem