Imported fix from dev: 646:25e5741ab71e - Moved the IsClientInBuyzone stock to the weapons module from ZMarket, and stop the "Zombies can't use weapons" phrase when using autobuy outside of a buyzone.

This commit is contained in:
Richard Helgeby
2010-02-14 17:03:19 +01:00
parent 05895df252
commit b39a684fd8
4 changed files with 34 additions and 29 deletions

View File

@ -127,9 +127,15 @@ WeaponsOnOffsetsFound()
LogEvent(false, LogType_Fatal, LOG_CORE_EVENTS, LogModule_Weapons, "Offsets", "Offset \"CBasePlayer::m_hActiveWeapon\" was not found.");
}
// If offset "m_bInBuyZone" can't be found, then stop the plugin.
g_iToolsInBuyZone = FindSendPropInfo("CCSPlayer", "m_bInBuyZone");
if (g_iToolsInBuyZone == -1)
{
LogEvent(false, LogType_Fatal, LOG_CORE_EVENTS, LogModule_Weapons, "Offsets", "Offset \"CCSPlayer::m_bInBuyZone\" was not found.");
}
// Forward event to sub-modules
WeaponAmmoOnOffsetsFound();
ZMarketOnOffsetsFound();
}
/**
@ -906,3 +912,14 @@ stock WeaponsRefreshAllClientWeapons(client)
WeaponsRefreshClientWeapon(client, WeaponsSlot:x);
}
}
/**
* Checks if a client is in a buyzone.
*
* @param client The client index.
*/
stock bool:WeaponsIsClientInBuyZone(client)
{
// Return if client is in buyzone.
return bool:GetEntData(client, g_iToolsInBuyZone);
}