Recoded weapon restrictions, and made new way of storing data. (Arrays)
* Removed ZMarket as an external plugin (to be integrated next commit) * Updated weapon configs, removed weapongroups.txt and moved weapons.txt to root zr config folder. * Moved offset finding to respective module, made new forward *OnOffsetsFound. * Updated weapons&hitgroups config file format to match playerclass.txt * Updated translations. * Recoded weapon restrict menu, commented out all zadmin options that don't quite work. * Added weaponammo module (not finished but existent) * Started zmarket module.
This commit is contained in:
47
src/zr/weapons/zmarket.inc
Normal file
47
src/zr/weapons/zmarket.inc
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* ============================================================================
|
||||
*
|
||||
* Zombie:Reloaded
|
||||
*
|
||||
* File:
|
||||
* Type: Module
|
||||
* Description:
|
||||
*
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
* Variable to store buyzone offset value.
|
||||
*/
|
||||
new g_iToolsInBuyZone;
|
||||
|
||||
/**
|
||||
* Initialize market data.
|
||||
*/
|
||||
ZMarketInit()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Find ZMarket-specific offsets here.
|
||||
*/
|
||||
ZMarketOnOffsetsFound()
|
||||
{
|
||||
// If offset "m_bInBuyZone" can't be found, then stop the plugin.
|
||||
g_iToolsInBuyZone = FindSendPropInfo("CCSPlayer", "m_bInBuyZone");
|
||||
if (g_iToolsInBuyZone == -1)
|
||||
{
|
||||
LogPrintToLog(LOG_FORMAT_TYPE_FATALERROR, "Tools", "Offsets", "Offset \"CCSPlayer::m_bInBuyZone\" was not found.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a client is in a buyzone.
|
||||
*
|
||||
* @param client The client index.
|
||||
*/
|
||||
stock bool:ZMarketIsClientInBuyZone(client)
|
||||
{
|
||||
// Return if client is in buyzone.
|
||||
return bool:GetEntData(client, g_iToolsInBuyZone);
|
||||
}
|
Reference in New Issue
Block a user