
Originally Posted by
Itutorial
Can anyone tell me why this doesn't work?
static int (__thiscall *CPlayer__FindItem)(void *thispointer, int a2, int a3) = (int (__thiscall*)(void *thispointerpointer, int a2, int a3))0x0045D1E0;
bool hasPickPet = false;
int pickpets[13] = {2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017};
int count;
for (count = 0; count <= 13; ++count); {
int pet = pickpets[count];
if (CPlayer__FindItem(pPlayer, pet, 1)) { <--- This part isn't working.
hasPickPet = true; }
}
you are using _FindItem @ 45D1E0 which is stdcall and not thiscall, you should be using FindItem @ 45D190.
change the address
from:
Code:
static int (__thiscall *CPlayer__FindItem)(void *thispointer, int a2, int a3) = (int (__thiscall*)(void *thispointerpointer, int a2, int a3))0x0045D1E0;
to:
Code:
static int (__thiscall *CPlayer__FindItem)(void *thispointer, int a2, int a3) = (int (__thiscall*)(void *thispointerpointer, int a2, int a3))0x0045D190;