Replacement wanted for Tf2Items_OnGiveNamed Item_Post
Has anyone come up with a method for replacing this:
PHP Code:
PHP Code:
|
Re: Replacement wanted for Tf2Items_OnGiveNamed Item_Post
OnEntityCreated is indeed too early to retrieve any information. However once the entity is spawned (same frame there's no delay), you can read that info up.
So assuming you know the weapon classname, you could SDKHook the Spawn function. And then read m_iEntityLevel or m_iItemDefinitionIndex netprops, under the spawn callback. PHP Code:
|
Re: Replacement wanted for Tf2Items_OnGiveNamed Item_Post
Unfortunately the classname and owner aren't known at this point. Any way to find out that info?
My goal is to fully remove dependency of TF2Items from the server. I've been able to accomplish most of that with TF_Econ_Data. However, I'm at a roadblock with this function. |
Re: Replacement wanted for Tf2Items_OnGiveNamed Item_Post
The item should be completely initialized during SDKHook_SpawnPost, not SDKHook_Spawn. That said, the owner probably isn't in place up until after the game calls GiveTo on it. But that happens after CTFPlayer::GiveNamedItem, so that shouldn't matter.
GiveNamedItem also calls the item's Touch method, so a TouchPost hook should tell you the player that spawned it in. |
Re: Replacement wanted for Tf2Items_OnGiveNamed Item_Post
If you don't know the classname, you could use "HasEntProp" under the OnEntityCreated forward, to figure which entity is an item. But that's less than ideal.
However, since DHooks is part of Sourcemod, you could simply do exactly what tf2items does in your plugin. PHP Code:
Edit : If you're still going for a no gamedata approach. Then consider HasEntProp PHP Code:
|
Re: Replacement wanted for Tf2Items_OnGiveNamed Item_Post
Any idea what I may be doing wrong? Getting this error while using sm version 1.11.0.6837:
PHP Code:
PHP Code:
|
| All times are GMT -4. The time now is 22:48. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.