2009-04-29 01:58:41 +02:00
|
|
|
/*
|
|
|
|
* ============================================================================
|
|
|
|
*
|
2009-07-05 08:49:23 +02:00
|
|
|
* Zombie:Reloaded
|
2009-04-29 01:58:41 +02:00
|
|
|
*
|
2009-06-12 05:51:26 +02:00
|
|
|
* File: tools.inc
|
|
|
|
* Type: Core
|
|
|
|
* Description: Find offsets and signatures.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 Greyscale, Richard Helgeby
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2009-04-29 01:58:41 +02:00
|
|
|
*
|
|
|
|
* ============================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize global offset variables.
|
|
|
|
*/
|
|
|
|
new g_iToolsVelocity;
|
|
|
|
new g_iToolsLMV;
|
|
|
|
new g_iToolsHasNightVision;
|
|
|
|
new g_iToolsNightVisionOn;
|
2009-12-11 15:16:28 +01:00
|
|
|
new g_iToolsFOV;
|
2009-05-29 08:43:15 +02:00
|
|
|
|
2009-04-29 01:58:41 +02:00
|
|
|
/**
|
|
|
|
* @endsection
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Tools Functions (core)
|
|
|
|
#include "zr/tools_functions"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tools module init function.
|
|
|
|
*/
|
|
|
|
ToolsInit()
|
|
|
|
{
|
|
|
|
// Find offsets.
|
|
|
|
ToolsFindOffsets();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Finds all offset values for the plugin.
|
|
|
|
*/
|
|
|
|
ToolsFindOffsets()
|
|
|
|
{
|
|
|
|
// If offset "m_vecVelocity[0]" can't be found, then stop the plugin.
|
|
|
|
g_iToolsVelocity = FindSendPropInfo("CBasePlayer", "m_vecVelocity[0]");
|
|
|
|
if (g_iToolsVelocity == -1)
|
|
|
|
{
|
2009-06-01 23:29:26 +02:00
|
|
|
LogEvent(false, LogType_Fatal, LOG_CORE_EVENTS, LogModule_Tools, "Offsets", "Offset \"CBasePlayer::m_vecVelocity[0]\" was not found.");
|
2009-04-29 01:58:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// If offset "m_flLaggedMovementValue" can't be found, then stop the plugin.
|
|
|
|
g_iToolsLMV = FindSendPropInfo("CCSPlayer", "m_flLaggedMovementValue");
|
|
|
|
if (g_iToolsLMV == -1)
|
|
|
|
{
|
2009-06-01 23:29:26 +02:00
|
|
|
LogEvent(false, LogType_Fatal, LOG_CORE_EVENTS, LogModule_Tools, "Offsets", "Offset \"CCSPlayer::m_flLaggedMovementValue\" was not found.");
|
2009-04-29 01:58:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// If offset "m_bHasNightVision" can't be found, then stop the plugin.
|
|
|
|
g_iToolsHasNightVision = FindSendPropInfo("CCSPlayer", "m_bHasNightVision");
|
|
|
|
if (g_iToolsHasNightVision == -1)
|
|
|
|
{
|
2009-06-01 23:29:26 +02:00
|
|
|
LogEvent(false, LogType_Fatal, LOG_CORE_EVENTS, LogModule_Tools, "Offsets", "Offset \"CCSPlayer::m_bHasNightVision\" was not found.");
|
2009-04-29 01:58:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// If offset "m_bNightVisionOn" can't be found, then stop the plugin.
|
|
|
|
g_iToolsNightVisionOn = FindSendPropInfo("CCSPlayer", "m_bNightVisionOn");
|
|
|
|
if (g_iToolsNightVisionOn == -1)
|
|
|
|
{
|
2009-06-01 23:29:26 +02:00
|
|
|
LogEvent(false, LogType_Fatal, LOG_CORE_EVENTS, LogModule_Tools, "Offsets", "Offset \"CCSPlayer::m_bNightVisionOn\" was not found.");
|
2009-04-29 01:58:41 +02:00
|
|
|
}
|
|
|
|
|
2009-12-11 15:16:28 +01:00
|
|
|
// If offset "m_iFOV" can't be found, then stop the plugin.
|
|
|
|
g_iToolsFOV = FindSendPropInfo("CBasePlayer", "m_iFOV");
|
|
|
|
if (g_iToolsFOV == -1)
|
2009-04-29 01:58:41 +02:00
|
|
|
{
|
2009-12-11 15:16:28 +01:00
|
|
|
LogEvent(false, LogType_Fatal, LOG_CORE_EVENTS, LogModule_Tools, "Offsets", "Offset \"CBasePlayer::m_iFOV\" was not found.");
|
2009-04-29 01:58:41 +02:00
|
|
|
}
|
|
|
|
|
2009-05-29 08:43:15 +02:00
|
|
|
// Forward event to modules.
|
|
|
|
WeaponsOnOffsetsFound();
|
|
|
|
AccountOnOffsetsFound();
|
2009-06-08 06:05:50 +02:00
|
|
|
VEffectsOnOffsetsFound();
|
2009-07-17 03:34:56 +02:00
|
|
|
NapalmOnOffsetsFound();
|
2009-04-29 01:58:41 +02:00
|
|
|
}
|