CEconItemView doesn't get initialised for custom weapons
I'm trying to create a custom weapon entity based on weapon_sg556 in CSGO.
I hooked CreateEntityByName function and replace my custom classname "weapon_custom" to "weapon_sg556" in the function parameters. After the weapon is spawned, players can't pick it up. I checked the sendprops and found that m_bInitialized is false, for normal weapon_sg556 that value false in postcreate and is true in prespawn hook. I checked the source code and found that this function should be called before spawn to set some parameters and m_bInitialized to true: Code:
void CEconItemView::Init( int iDefIndex, int iQuality, int iLevel, uint32 iAccountID ) The engine somehow knows that the original classname is another, not weapon_sg556 and prevents weapon initialisation. Form the source code it's not clear where Init( is called from. My questions: 1) How CEconItemView gets initialised for ordinary weapons? 2) Can I somehow debug it, or does anobody know what could be the reason? 3) Can I somehow initialise CEconItemView? |
Re: CEconItemView doesn't get initialised for custom weapons
You probably want to hook GiveNamedItem on the player instead.
|
All times are GMT -4. The time now is 22:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.