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:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user