alliedmodders / sourcemod

SourceMod - Source Engine Scripting and Administration
http://www.sourcemod.net/
973 stars 422 forks source link

MP5-SD is visible as MP7 on SDKHook_WeaponEquipPost #962

Closed d0naciak closed 5 years ago

d0naciak commented 5 years ago

When I pickup a MP5-SD from the ground, and I'm hooking it by SDKHook_WeaponEquipPost, m_iClassname returns "weapon_mp7". I think It should return "weapon_mp5sd". Is it possible to fix?

psychonic commented 5 years ago

weapon_mp7 is the entity classname of the weapon_mp5sd item (and the weapon_mp7 item). Not all items have their own entity class - some share a single class so that game logic is not duplicated. This is nothing to do with SourceMod or SDKHooks, but how the game implements the items.

I don't know offhand if it is possible to get the item name directly via SourceMod, but it is possible via extensions.