Most visitors online was 10387 , on 26 Apr 2024
Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!
Join Today!or if you wanna keep using your function, the arguments you're calling are wrong. it should be like this:static int (__stdcall *InsertItem)(int Player, int Value, int Index, int Prefix, int Amount, int Argument) = (int (__stdcall*)(int,int,int,int,int,int))0x004274A0;
Player isnt the PID, its the offset (in ur case thisPointer) and the Argument isnt the amount.static int(__thiscall *InsertItem)(void *Player, int Argument, int Item) = (int(__thiscall*)(void*, int, int))0x0045DDC0;
Example:static int (__cdecl *CreateItem)(int Index, int Prefix, int Value, int Argument) = (int (__cdecl*)(int,int,int,int))0x00426110;
int xItem = CreateItem(YourIndex, 0, Amount, -1);
if (xItem)
{
if (InsertItem(thisPointer, 27, xItem) == 1)
//successfully given item
}
- for(int i = 1; i < 10; i++)
- {
- LevelUp(thisPointer);
- }
namespace CPlayer
{
static int (__thiscall *FindItem)(void *Player, int ItemIndex, int Amount) = (int (__thiscall*)(void*,int,int))0x0045D190;
}
namespace CItem
{
static int (__thiscall *RemoveItem)(void *Player, int Item) = (int (__thiscall*)(void*,int))0x0046F320;
}
- void __fastcall Hooked_Tick(int* thisPointer)
- {
int Plevel = thisPointer[15];
int PClass = thisPointer[115];
if (Plevel == 1)
{
if(PClass == 0 && CPlayer::FindItem(thisPointer,1,1))
{
//here you insert the items you want
CItem::RemoveItem(thisPointer,1);
}
}
Tick(thisPointer);
}
Btw, is this going to lvl up your player to lvl 9?
Why dont you scan the player inventory if he is lvl 1 and have the item X?
he does, this was just the called func, in the hook he do check for that PLvl ->, Pitem -> X