Get current vehicle modelid

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
52
Location
LongForgotten <-> 0x32789
not really useful but if you want to get your current modelid and don't have CVehicle this can be in use (as it was right now for me..)

Code:
WORD GetCurrentVehicleModel()
{
	if (*(int*)(0xBA18FC) == NULL) return 0; // NO VEHICLE, ONFOOT?

	DWORD vptr = *(DWORD*)(0xBA18FC);
	vptr = *(DWORD*)(vptr + 0x22); // 0x22 = 34, CVehicle + 0x34 = [word] Vehicle ID from vehicles.ide

	return (WORD)(WORD*)vptr;
}

splaination:
0xBA18FC is the pointer to our current vehicle (CVehicle), if it's 0, we aren't in any vehicle or onfoot. (you can use this to detect for onfoot requirement on ur cheat)
In the memory addresses wiki, the pointer + 34 bytes will point to the Vehicle ID from vehicles.ide, vehicle ID is basically the model ID in vehicles.ide..
so we read that memory value and get the model, the value is returned 0 if player is no car.
 
Top