πŸ’¬ Getting Entity Weapon ID doesn't work.

Posts 1–2 of 2 Β· Page 1 of 1
πŸ’¬ Getting Entity Weapon ID doesn't work.
Hi! I have loop of players, where I process them. I need to get each player weapon ID, but my code doesn't work ;x

(Getting team id and hp works)

Code:
DWORD weaponData = Mem.Read<DWORD>((DWORD)Player.pEntity + m_hActiveWeapon);
int weaponEntityIndex = weaponData &= 0xFFF;

DWORD weaponEntity = Mem.Read<DWORD>(ClientDLL + EntityList + (weaponEntityIndex * 0x10));
int weaponID = Mem.Read<int>(weaponEntity + m_iWeaponID);

int team = Mem.Read<int>((DWORD)Player.pEntity + m_iTeamNum);
int hp = Mem.Read<int>((DWORD)Player.pEntity + m_iHealth);

printf("ID: %d | Team: %d | HP: %d | WeaponID: %d\n", i, team, hp, weaponID);

Aaaand my newest offsets:
Code:
const DWORD EntityList = 0x4A10034;
const DWORD m_hActiveWeapon = 0x12C0;
const DWORD m_iWeaponID = 0x1684;
(ClientDLL = Mem.Module("client.dll")

Yes, I am beginning with coding hacks, I've already made triggerbot and glowing enemies/allies/high value weapons - not copy&paste, just write from 0

If anyone has any helpful idea, it will be very nice to know it

//Addon
i.gyazo.com/fd5535ebe371bb423dd84572279b4c88.png

It gives me these values 10 second after starting 1st round ;x

- - - Updated - - -

Never mind, now works.

Code:
int weaponIndex = Mem.Read<DWORD>((DWORD)Player.pEntity + m_hActiveWeapon) & 0xFFF;

DWORD weaponEntity = Mem.Read<DWORD>((ClientDLL + EntityList + weaponIndex * 0x10) - 0x10);
int weaponID = Mem.Read<int>(weaponEntity + m_iWeaponID);

int team = Mem.Read<int>((DWORD)Player.pEntity + m_iTeamNum);
int hp = Mem.Read<int>((DWORD)Player.pEntity + m_iHealth);

printf("ID: %d | Team: %d | HP: %d | WeaponID: %d\n", i, team, hp, weaponID);
Quote Originally Posted by karer123 View Post
Hi! I have loop of players, where I process them. I need to get each player weapon ID, but my code doesn't work ;x

(Getting team id and hp works)

Code:
DWORD weaponData = Mem.Read<DWORD>((DWORD)Player.pEntity + m_hActiveWeapon);
int weaponEntityIndex = weaponData &= 0xFFF;

DWORD weaponEntity = Mem.Read<DWORD>(ClientDLL + EntityList + (weaponEntityIndex * 0x10));
int weaponID = Mem.Read<int>(weaponEntity + m_iWeaponID);

int team = Mem.Read<int>((DWORD)Player.pEntity + m_iTeamNum);
int hp = Mem.Read<int>((DWORD)Player.pEntity + m_iHealth);

printf("ID: %d | Team: %d | HP: %d | WeaponID: %d\n", i, team, hp, weaponID);

Aaaand my newest offsets:
Code:
const DWORD EntityList = 0x4A10034;
const DWORD m_hActiveWeapon = 0x12C0;
const DWORD m_iWeaponID = 0x1684;
(ClientDLL = Mem.Module("client.dll")

Yes, I am beginning with coding hacks, I've already made triggerbot and glowing enemies/allies/high value weapons - not copy&paste, just write from 0

If anyone has any helpful idea, it will be very nice to know it

//Addon
i.gyazo.com/fd5535ebe371bb423dd84572279b4c88.png

It gives me these values 10 second after starting 1st round ;x

- - - Updated - - -

Never mind, now works.

Code:
int weaponIndex = Mem.Read<DWORD>((DWORD)Player.pEntity + m_hActiveWeapon) & 0xFFF;

DWORD weaponEntity = Mem.Read<DWORD>((ClientDLL + EntityList + weaponIndex * 0x10) - 0x10);
int weaponID = Mem.Read<int>(weaponEntity + m_iWeaponID);

int team = Mem.Read<int>((DWORD)Player.pEntity + m_iTeamNum);
int hp = Mem.Read<int>((DWORD)Player.pEntity + m_iHealth);

printf("ID: %d | Team: %d | HP: %d | WeaponID: %d\n", i, team, hp, weaponID);
Yup you have to subtract 1 from the ID you got from the handle.
Posts 1–2 of 2 Β· Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us