HelpC# Get Weapon ID

Posts 1–8 of 8 · Page 1 of 1
C# Get Weapon ID
I've tried everything but it keeps reading 0.

Code:
public int m_iWeapon()
            {
                int handle = fProcess.ReadInt(m_dwLocalPlayer() + Offsets.Default.ActiveWeapon) & 0xFFF;
                int entity = m_dwBaseEntity(handle - 1);
                int id = fProcess.ReadInt(entity + Offsets.Default.AttributeManager + Offsets.Default.Item + +Offsets.Default.ItemDefinitionIndex);
                return id;
            }
Hello,

Pseudocode:

ActiveWeapon = Read(Base + m_hActiveWeapon)
ActiveWeapon &= 0xFFF;
WeaponEnt = Read(Client.dll + m_dwEntityList + (ActiveWeapon - 1) * 0x10)
WeaponID = Read(WeaponEnt + m_iItemDefinitionIndex);

There you go.

Kind Regards,
x5589po9cP
Quote Originally Posted by x5589po9cP View Post
Hello,

Pseudocode:

ActiveWeapon = Read(Base + m_hActiveWeapon)
ActiveWeapon &= 0xFFF;
WeaponEnt = Read(Client.dll + m_dwEntityList + (ActiveWeapon - 1) * 0x10)
WeaponID = Read(WeaponEnt + m_iItemDefinitionIndex);

There you go.

Kind Regards,
x5589po9cP
Code:
int handle = fProcess.ReadInt(m_dwLocalPlayer() + Offsets.Default.ActiveWeapon) & 0xFFF;
                int entity = m_dwBaseEntity(handle - 1);
                int id = fProcess.ReadInt(entity + Offsets.Default.ItemDefinitionIndex);
Still reads 0. My offsets are up to date.
Well it works on my Side:

Code:
i.imgur.com/WVCQ7V1.png
The Last three Numbers are the Different WeaponID's.
Quote Originally Posted by x5589po9cP View Post
Well it works on my Side:

Code:
i.imgur.com/WVCQ7V1.png
The Last three Numbers are the Different WeaponID's.
Oh, is that internal?
Yes, but I got the same code external too. You can make it Work Internal and External.

Your Line:
int entity = m_dwBaseEntity(handle - 1);

My Line:

WeaponEnt = Read(Client.dll + m_dwEntityList + (ActiveWeapon - 1) * 0x10)

Do:
int entity = Read(Client.dll + m_dwEntityList + (handle - 1) * 0x10);

This is no CopyPaste Code but you get the Idea
Quote Originally Posted by x5589po9cP View Post
Yes, but I got the same code external too. You can make it Work Internal and External.

Your Line:
int entity = m_dwBaseEntity(handle - 1);

My Line:

WeaponEnt = Read(Client.dll + m_dwEntityList + (ActiveWeapon - 1) * 0x10)

Do:
int entity = Read(Client.dll + m_dwEntityList + (handle - 1) * 0x10);

This is no CopyPaste Code but you get the Idea
Code:
public int m_dwBaseEntity(int index)
            {
                return fProcess.ReadInt("client.dll", (Offsets.Default.EntityList + (index * Offsets.Default.EntityLoopDistance)));
            }
Never mind, the break point was on the wrong line. It is working now.
Been over a week since last update/bump after answers, assuming solved.

/Closed.
Posts 1–8 of 8 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?