I come bearing more fruit.
First, my log:
Code:
C44BE5CA 439C6848 C3C718EB 44D52432 45E3B0E7 45268626 00000000 00000000 00000000 00000000 00000000 00000000 3747003 3747003 6E6A095 41C88280 4205AC55 7F7FFFFF 2
C44F5679 43E13F57 C32F965D 4507BB60 45CD4673 4529713F 00000000 00000000 00000000 00000000 00000000 00000000 00F0D002 00F0D002 03882139 0 4205F810 7F7FFFFF 2 0 0 1 0 0 0
|--------position?-------| ^atkr/inflctr ^wapon ^ damage (float) ^flgs
C451148C 437FFC59 44565600 43F7D6D8 45B33DA5 4535E080 00000000 00000000 00000000 C07BC52E C0458390 00000000 014DB0EC 0016B001 014DB0EC 0 428C0000 7F7FFFFF 200004 0 0
C3B30F35 C45AD69C C324A4A2 43EA034A 45B10A6B 45353E9D 00000000 00000000 00000000 00000000 00000000 00000000 0016B001 0016B001 07B1C09E 3F9BE5BA 420B31AF 7F7FFFFF 000002 0 0 1
^Pistol
C41CEDE0 C47EE809 4380C73B 43F307BE 45B21EB2 4535E080 00000000 00000000 00000000 C09ED447 3F1A908E 80000000 02DAF179 0016B001 02DAF179 00000000 42480000 7F7FFFFF 200004 0 0 FFFFFFFF
^Fireaxe
422283FB 4415A7DC 80000000 445176EC 45AF349E 45260080 00000000 00000000 00000000 00000000 00000000 00000000 025761AC 025761AC FFFFFFFF 40000000 40000000 7F7FFFFF 80 0 0 FFFFFFFF
^Zombozo hit on coach
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 06BA11AA 0189A005 FFFFFFFF 40377800 40377800 7F7FFFFF 40400 0 DAAB5E0 FFFFFFFF 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
^spitter on coach
//------//------//------//------//------//------//------//------//------//------//------//------//------//------//------
//------//------//------//------//------//------//------//------//------//------//------//------//------//------//------
//------//------//------//------//------//------//------//------//------//------//------//------//------//------//------
HLSDK attacked Nick
442B2E55 44252C97 C2FED0C2 44204F3C 45B4D901 453496C0 0 0 0 0 0 0 16E001 16E001 6D80E7 3F93041F 420343AE 7F7FFFFF 2 0 0 1
[SM] Attacker: CTerrorPlayer, inflictor CPistol attacked Victim: Nick for 32.816093 damage
HLSDK attacked Nick
C49254C6 42C3C3FC 43AD3464 43FF486B 45B3A25C 4535E080 0 0 0 BFDF3307 4095F460 80000000 693C1B0 16E001 693C1B0 3FE00000 42480000 7F7FFFFF 200004 0 0 FFFFFFFF
[SM] Attacker: CTerrorMeleeWeapon, inflictor CTerrorMeleeWeapon attacked Victim: Nick for 50.000000 damage
//------//------//------//------//------//------//------//------//------//------//------//------//------//------//------
//------//------//------//------//------//------//------//------//------//------//------//------//------//------//------
//------//------//------//------//------//------//------//------//------//------//------//------//------//------//------
Second, my class changes / padding to CTakeDamageInfo:
Code:
Vector m_vecDamageForce;
Vector m_vecDamagePosition;
Vector m_vecReportedPosition; // Position players are told damage is coming from --always null in testing
float m_DUMMY[3];
EHANDLE m_hAttacker;
EHANDLE m_hWeapon;
EHANDLE m_hInflictor;
float m_DUMMY1[1];
float m_flDamage;
float m_flMaxDamage;
int m_bitsDamageType;
float m_flBaseDamage; // The damage amount before skill leve adjustments are made. Used to get uniform damage forces.
int m_iDamageCustom;
int m_iDamageStats;
int m_iAmmoType; // AmmoType of the weapon used to cause this damage, if any
Notes - I may have things after flBaseDamage incorrect. I don't think they are passed to the user anyway.
That's pretty much it, just some padding. I also have a test .sp file:
PHP Code:
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod Anti-Flood Plugin
* Protects against chat flooding.
*
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* 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/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#pragma semicolon 1
#include <sourcemod>
#include <sdkhooks>
public Plugin:myinfo =
{
name = "L4D2_Testing",
author = "HL-SDK",
description = "Reverse engineering helper buddy",
version = SOURCEMOD_VERSION,
url = "http://www.sourcemod.net/"
};
new Handle:sm_tenable; /* Handle to test enable convar */
public OnPluginStart()
{
sm_tenable = CreateConVar("sm_tenable", "1", "ENABLE LOGGING OUR STUFF");
}
public OnClientPutInServer(client)
{
if (client == 100 || client == 2)
{
SDKHook(client, SDKHook_OnTakeDamagePost, OnTakeDamagePost);
ShowActivity(0, "OnClientPutInServer: %i", client);
ShowActivity(0, "Hooked!: %i", client);
}
else
{
ShowActivity(0, "OnClientPutInServer: %i", client);
}
}/* LogAction(client, -1, "\"%L\" refreshed the admin cache.", client); */
public OnTakeDamagePost(victim, attacker, inflictor, Float:damage, damagetype)
{
decl String:victimName[20];
GetClientName(victim, victimName, 20);
decl String:attackerName[20];
GetEntityNetClass(attacker, attackerName, 20);
decl String:inflictorName[20];
GetEntityNetClass(inflictor, inflictorName, 20);
ShowActivity(0, "Attacker: %s, inflictor %s attacked Victim: %s for %f damage", attackerName, inflictorName, victimName, damage);
}
Nothing too professional, but it is trivial to add OnTakeDamage hooks into L4D2 now, because of psychonic and I.