This is what I said....
You will need okapi module. I spend so much time on something that I won't ever need.
Note : I know this signatures are ridiculously long, but there are very similar functions, I was not able to get a shorter one. If someone knows a trick for making them shorter I am open to suggestions.
// this block should be used for Counter-Strike: /*if(wId == CSW_C4) { cs_set_user_plant(id,0,0); cs_set_user_bpammo(id,CSW_C4,0); } else if(wId == CSW_SMOKEGRENADE || wId == CSW_FLASHBANG || wId == CSW_HEGRENADE) cs_set_user_bpammo(id,wId,0);*/
return 1; }
public CBasePlayer_ItemDeploy(Ent) { EnableHamForward(HandleCBaseEntity_AK47IdleHook) }
public CBasePlayer_ItemHolster(Ent) { DisableHamForward(HandleCBaseEntity_AK47IdleHook) }
This works exactly as you wanted. Edit it as you like.
A few technical notes:
1. I have not used orpheu because it does not support Vector class. It somehow works when calling, but crash when hooking. Even when calling, it does not pass the vectors correctly and you will have to manually set origin, also this fuck up the other params like m_usEvent. okapi does not have this problem.
2. Even with okapi, we need to set velocity manually, but this is not a big deal.
Here are the signatures in orpheu format, in case someone needs them, but you should not:
A signature can be started from where you want. Just matter to adjusted (displacement) if needed.
I'm not sure it's a good idea to use Okapi, it's still in beta, and there is likely some leaked memory.
I was thinking at this too, but I don't think displacement will help. Functions are almost identical, but I will try to start them from there it sets think(different think function).
I know about the memory leak(I was the one who reported it), but I does not happen on normal function, it's related to virtual functions. My throwablec4 runs just fine in linux.
very nice, im impressed, is exactly what i was looking for, but i have the following issues now
1. If i have more grenades of the same type in the inventory, and i launch grenade by right click, a grenade is launched and the others dissapear from the inventory
2. If i have HE and SMOKE in the inventory and i right click, both of them are throwed one after the other
3. If i have more grenade types, for example HE and SMOKE, and i have more than one HE grenade, after the grenades are being launched, the HE grenade is deployed, but the model remains of the AK ( This doesn't happen if i have Flash and Smoke )
Also, how could i switch betwen grenade type ?
im sorry, i can't get these fixed by myself, right now im looking over your code, and it looks like alien technology for me hahaha
i have a model, but i didnt start working on the custom animation yet..
i didn't have time, i've been pretty busy trying to reproduce a crash and get some error logs out of the snark infector plugin...
i will start working on the custom animation tomorow, and i will post it here
btw, if you have any cool weapon model in mind, let me know, im looking for days for something realy good, but i couldn't find anything that's badass