Actually my method works and your plugin works fine aswell, but you can't assign skins on default knives. You have to use it on karambit or bayonet and such. You could do submenu, letting them select knife first and then skin.
The menus would look something like
Code:
1. Weapons -> (use stattrak or not or randomize it) -> select the skin you want to apply
2. Knives -> (use stattrak or not or randomize it) -> select any knife (karambit, bayonet) etc -> select the skin you want to apply
I included how i fixed it, by moving down the Equip.
Note that i changed line 95 to
PHP Code:
new entity = GivePlayerItem(client, "weapon_knife_karambit");
for testing, so you have to change it back Franc1sco
also for best looks i recommend you setting the quality so close to the minimal wear as possible using prop
PHP Code:
SetEntPropFloat(entity, Prop_Send, "m_flFallbackWear", 0.1); // using 0.0 gives it a bad look :s ? 1.0 worst (BS) and 0.1 best (MW)
and for some styling using the "star" next to knife name use. You would probably want to do this inside the check if it is a knife we are applying to.
PHP Code:
SetEntProp(entity, Prop_Send, "m_iEntityQuality", 3); //Sets the star icon before knife name
also for the sake of fun, you could do randomly assign stattrak or not. -1 will set the weapon to normal and anything above will set it as stattrak and number of kills.
PHP Code:
new stattrakcount = GetRandomInt(-1, 10000);
SetEntProp(entity, Prop_Send, "m_nFallbackStatTrak", stattrakcount); //-1 not stattrak, >= 0 is stattrak