DiscussionExternal Knife Changer
Thanks a lot to legit_player and PhY'z 

Damn, what am I doing wrong...
Is there a way to fix the "sword" problem ? It's working fine with bots but knife is a sword on online games x)
Yes it's false, you have to read the knifeBase (juste like you read a weaponBase when you are doing a skinChanger for example) but use hViewModel instead of hActiveWeapon.
thanks to @legit_player and @PhY'z
thanks to @legit_player and @PhY'z
Still having issues implementing this. Maybe I'm overlooking something...
To scan through my current weapons, I use this code: (currently only checks for default knives because that's what I have on my loadout, but later I can add in all the other knives)
For applying the knife + skin, I'm using this code. (Values are currently hardcoded for testing):
I'm using both weaponEntity and knifeEntity because the fallbacks are in a different location to the viewmodel and need a different base. I assume that's correct but then again, it causes my game to crash. Normal skins apply properly though. Any thoughts?
To scan through my current weapons, I use this code: (currently only checks for default knives because that's what I have on my loadout, but later I can add in all the other knives)
Code:
void scanWeaponSkins()
{
for (;;)
{
if (skinEnabled)
{
for (int i = 1; i <= 4; i++)
{
DWORD currentWeapon = kvsMem.Read<DWORD>(LocalBase + 0x2DE8 + ((i - 1) * 0x04));
DWORD currentWeaponEntityID = currentWeapon & 0xfff;
DWORD weaponEntity = kvsMem.Read<DWORD>(Client + m_dwEntityList + (currentWeaponEntityID - 1) * 0x10);
nWeaponIndex = getWeapIndex(weaponEntity);
if (nWeaponIndex != WEAPON_KNIFE && nWeaponIndex != WEAPON_KNIFE_T)
{
applyCustomSkin(weaponEntity);
}
else
{
DWORD currentKnife = kvsMem.Read<DWORD>(LocalBase + 0x32F0);
DWORD currentKnifeEntityID = currentKnife & 0xfff;
DWORD knifeEntity = kvsMem.Read<DWORD>(Client + m_dwEntityList + (currentKnifeEntityID - 1) * 0x10);
applyKnife(weaponEntity, knifeEntity);
}
}
}
Sleep(1);
}
}
Code:
bool applyKnife(DWORD weaponEntity, DWORD knifeEntity)
{
if (g_SkinChangerCfg.find(nWeaponIndex) == g_SkinChangerCfg.end())
{
return false;
}
else
{
kvsMem.Write<int>(weaponEntity + 0x3160, 0);//m_OriginalOwnerXuidLow
kvsMem.Write<int>(weaponEntity + 0x3164, 0);//m_OriginalOwnerXuidHigh
kvsMem.Write<int>(knifeEntity, 330);//m_hViewmodel
kvsMem.Write<int>(weaponEntity + 0x2F88, 509);//m_iItemDefinitionIndex
kvsMem.Write<int>(weaponEntity + 0x3168, g_SkinChangerCfg[nWeaponIndex].nFallbackPaintKit);//m_nFallbackPaintKit
kvsMem.Write<float>(weaponEntity + 0x3170, g_SkinChangerCfg[nWeaponIndex].flFallbackWear);//m_flFallbackWear
kvsMem.Write<int>(weaponEntity + 0x3174, g_SkinChangerCfg[nWeaponIndex].nFallbackStatTrak);//m_nFallbackStatTrak
kvsMem.Write<int>(weaponEntity + 0x2FA0, 1);//m_iItemIDHigh
return true;
}
}
Having the same problem. Tried many different possibilities, still can't get model to change. Would you, who managed to get that working, mind sharing how you did it ?
EDIT: nvm, got it working.
EDIT: nvm, got it working.
Similar Threads
Counter-Strike 2 Coding & ResourcesExternal Knife changer
12 Counter-Strike 2 Coding & ResourcesKnife Changer - ExternalDR 7 Counter-Strike 2 HacksMewlaw External Multihack v1.6 [rage/legit] - Knife Changer <3 71 Counter-Strike 2 Coding & ResourcesKnife changer infos
48 Counter-Strike 2 HelpAnyone know of any knife changer thats UD?SA 3
