Hey, I'm trying to create an int function that will return a ped from a player ID supplied.
I do have the struct of the pool, however I don't have the memory address, or the knowledge to how to get it. I did try to go to this offset the user Parazitas sent in one of the threads.
samp.dll + 0x26EA0C + 0x3DE + 0x4
However when I tried to access it in ghidra, or in x32dbg I was met with an empty result, it might be because of my inexprience but i don't know really.
If you can help me with building the function from scratch, thank you.
Here are my resources: (taken from s0beit)
struct SampPlayerPool // This is taken from s0beit.
{
//uint32_t ulMaxPlayerID;
int iLocalPlayerScore;
uint16_t sLocalPlayerID;
void* pVTBL_txtHandler;
std::string strLocalPlayerName;
int iLocalPlayerPing;
struct stLocalPlayer* pLocalPlayer;
int iIsListed[SAMP_MAX_PLAYERS];
BOOL bSavedCheckCollision[SAMP_MAX_PLAYERS];
struct stRemotePlayer* pRemotePlayer[SAMP_MAX_PLAYERS];
int largestID;
};
SampPlayerPool* g_Players = nullptr;
I'm guessing to myself we would need to iterate over the pool samp fills with, access the sLocalPlayerId and check with the input that was given.
I do have the struct of the pool, however I don't have the memory address, or the knowledge to how to get it. I did try to go to this offset the user Parazitas sent in one of the threads.
samp.dll + 0x26EA0C + 0x3DE + 0x4
However when I tried to access it in ghidra, or in x32dbg I was met with an empty result, it might be because of my inexprience but i don't know really.
If you can help me with building the function from scratch, thank you.
Here are my resources: (taken from s0beit)
struct SampPlayerPool // This is taken from s0beit.
{
//uint32_t ulMaxPlayerID;
int iLocalPlayerScore;
uint16_t sLocalPlayerID;
void* pVTBL_txtHandler;
std::string strLocalPlayerName;
int iLocalPlayerPing;
struct stLocalPlayer* pLocalPlayer;
int iIsListed[SAMP_MAX_PLAYERS];
BOOL bSavedCheckCollision[SAMP_MAX_PLAYERS];
struct stRemotePlayer* pRemotePlayer[SAMP_MAX_PLAYERS];
int largestID;
};
SampPlayerPool* g_Players = nullptr;
I'm guessing to myself we would need to iterate over the pool samp fills with, access the sLocalPlayerId and check with the input that was given.