View Single Post
Muhlex
Junior Member
Join Date: Mar 2019
Old 05-27-2019 , 06:50   Re: [CSGO] Possible to get the Weapon Name from Weapon ID? (Not Classname!)
Reply With Quote #5

So I now built this:

PHP Code:
int iWeapon GetPlayerWeaponSlot(iClient1);
int iWeaponItemDefIndex GetEntProp(iWeaponProp_Send"m_iItemDefinitionIndex");

CSWeaponID cswWeaponToCheck CS_AliasToWeaponID("weapon_usp_silencer");
int iWeaponToCheckItemDefIndex CS_WeaponIDToItemDefIndex(cswWeaponToCheck);

if (
iWeaponItemDefIndex == iWeaponToCheckItemDefIndex)
{
  
// SUCCESS

Which actually seems to work flawlessly. Every weapon has it's own ItemDefIndex that skins don't seem to change.

Thanks a lot. Will report if I have more time to test and if it doesn't work in some case.
Muhlex is offline