External Knife changer
So I'm pretty clueless as to what I need to modify for this to work. I already experimented with using console commands to set the model, which worked fine because my code set the skin and everything else. Here is my function to write to my knife:
The bsendpackets everywhere is because somebody told me to use those so the knife would set. However, he did not tell me where to put them so I have them everywhere, but they actually mess up the knife when I set it (e.g. the skin goes on my t knife but it doesn't change the name of the knife to bayonet).
Code:
//x = the paint
//y = the item index value
//z = the model value
//ent = the knife weapon entity
void WriteKnife(int x, int y, int z, DWORD ent)
{
fProcess.Write<bool>((fProcess.__dwordEngine + cl_move + bsendpacket), false);
Sleep(1);
fProcess.Write<bool>((fProcess.__dwordEngine + cl_move + bsendpacket), true);
fProcess.Write<int>((ent + itemIDH), -1); //itemidhigh
fProcess.Write<int>((ent + itemIDL), -1); //itemidlow
fProcess.Write<int>((ent + xuidLow), 0); //xuidlow
fProcess.Write<int>((ent + xuidHigh), 0); //xuidhigh
fProcess.Write<int>((ent + itemQuality), 3); // quality
fProcess.Write<int>((ent + itemPaint), x); //paint
fProcess.Write<float>((ent + itemWear), 0.00001f); //wear
fProcess.Write<bool>((fProcess.__dwordEngine + cl_move + bsendpacket), false);
Sleep(1);
fProcess.Write<bool>((fProcess.__dwordEngine + cl_move + bsendpacket), true);
fProcess.Write<bool>((fProcess.__dwordEngine + cl_move + bsendpacket), false);
fProcess.Write<int>((ent + modelIndex), z);
fProcess.Write<bool>((fProcess.__dwordEngine + cl_move + bsendpacket), true);
fProcess.Write<int>((ent + item), y);
fProcess.Write<bool>((fProcess.__dwordEngine + cl_move + bsendpacket), false);
Sleep(1);
fProcess.Write<bool>((fProcess.__dwordEngine + cl_move + bsendpacket), true);
cstate = fProcess.Read<DWORD>(fProcess.__dwordEngine + enginepos);
fProcess.Write<int>((cstate + deltatick), -1); //force update
}
