LightbulbDiscussionExternal Knife Changer

Posts 16–25 of 25 · Page 2 of 2
Quote Originally Posted by 4nuoFZf9aE View Post


Whatchu need modelindex for on animations?
not for animations but you need modelindex to change the models and its a bit trickier to get it externally
Thanks a lot to legit_player and PhY'z
Quote Originally Posted by Background View Post
Thanks a lot to legit_player and PhY'z
It is not that difficult to do. :P
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)
Quote Originally Posted by VGZDESIGN View Post
int player = process.readInt(clientDLL + m_dwLocalPlayer);
int hViewModel = process.readInt(player + hViewModel);

Could you please tell me if it's correct ?
Thanking you in advance.
Wouldn't this grab the current player viewmodel, not the gun viewmodel, since it's listed under DT_BasePlayer? I don't see anything about hViewmodel under DT_BaseCombatWeapon.
Quote Originally Posted by Azsry View Post
Wouldn't this grab the current player viewmodel, not the gun viewmodel, since it's listed under DT_BasePlayer? I don't see anything about hViewmodel under DT_BaseCombatWeapon.
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
Quote Originally Posted by Background View Post
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
Thats right, then you just do simple check.
if (Weapon == Knife)
set the model
Quote Originally Posted by legit_player View Post
Thats right, then you just do simple check.
if (Weapon == Knife)
set the model
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)
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);
	}	
}
For applying the knife + skin, I'm using this code. (Values are currently hardcoded for testing):
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;
	}
}
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?
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.
Posts 16–25 of 25 · Page 2 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?