Raised This Month: $12 Target: $400
 3% 

Tank Damage Announce by griffin


Post New Thread Reply   
 
Thread Tools Display Modes
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 12-15-2020 , 21:27   Re: Tank Damage Announce by griffin
Reply With Quote #31

What actually you want from the plugin?
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.
GsiX is offline
ZBzibing
Senior Member
Join Date: Dec 2012
Old 11-13-2021 , 13:40   Re: Tank Damage Announce by griffin
Reply With Quote #32

Does anyone support it?
ZBzibing is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 11-13-2021 , 14:36   Re: Tank Damage Announce by griffin
Reply With Quote #33

Better try another plugin, there are several ones that do the same or similar stuff.

Check: https://forums.alliedmods.net/showpo...24&postcount=7
__________________

Last edited by Marttt; 11-13-2021 at 14:40.
Marttt is offline
ZBzibing
Senior Member
Join Date: Dec 2012
Old 11-14-2021 , 00:46   Re: Tank Damage Announce by griffin
Reply With Quote #34

After hard work, I have found his latest version. And the WIN system SM110 and MM111 tests have been completed, and he has solved all the previous problems.

https://github.com/SirPlease/L4D2-Co...ge_announce.sp
ZBzibing is offline
Mika Misori
Senior Member
Join Date: Sep 2022
Old 06-05-2023 , 07:56   Re: Tank Damage Announce by griffin
Reply With Quote #35

Quote:
Originally Posted by Marttt View Post
Better try another plugin, there are several ones that do the same or similar stuff.
Quote:
Originally Posted by ZBzibing View Post
After hard work, I have found his latest version.
Does anyone know a plugin that report the damage done to tank into the chat, but does not count the damage from molotov?

I found only this plugin: https://forums.alliedmods.net/showthread.php?t=329865
but it is for statistics, which is displayed on transition to the next map.

I want to know who really shot/hit tank and how much real damage was done by player's guns/melee, but not the damage from someone threw a molo, after which all just run away from tank.
Mika Misori is offline
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 06-05-2023 , 18:57   Re: Tank Damage Announce by griffin
Reply With Quote #36

Quote:
Originally Posted by Mika Misori View Post
Does anyone know a plugin that report the damage done to tank into the chat, but does not count the damage from molotov?

I found only this plugin: https://forums.alliedmods.net/showthread.php?t=329865
but it is for statistics, which is displayed on transition to the next map.

I want to know who really shot/hit tank and how much real damage was done by player's guns/melee, but not the damage from someone threw a molo, after which all just run away from tank.

Untested

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdkhooks>
#include <sdktools>

#define PLUGIN_VERSION "1.0"

int g_iPlayerTankDamage [MAXPLAYERS+1][MAXPLAYERS+1];

public 
void OnPluginStart()
{
    
HookEvent("player_hurt"Event_PlayerHurtEventHookMode_Post);
    
    
HookEvent("tank_killed"Event_TankKilledEventHookMode_Post);
    
HookEvent("player_death"Event_TankKilledEventHookMode_Post);
}

void Event_PlayerHurt(Event event, const char[] namebool dontBroadcast)
{
    
int victim GetClientOfUserId(event.GetInt("userid"));
    if (!
victim || !IsPlayerTank(victim) || IsTankInDeathAnimation(victim)) return;
    
    
int attacker GetClientOfUserId(event.GetInt("attacker"));
    if (!
attacker || !IsClientInGame(attacker) || GetClientTeam(attacker) != 2) return;
    
    
int iDamage event.GetInt("dmg_health");
    
int iType event.GetInt("type");
    
    
//This line to uncount fire damage, if it doesnt work, you need to check the fire damage type and block it, I cant access the game atm
    
if(IsFireDamage(iType)) iDamage 0;
    
    
g_iPlayerTankDamage[attacker][victim] += iDamage;
}

void Event_TankKilled(Event event, const char[] namebool dontBroadcast)
{
    
int victim GetClientOfUserId(event.GetInt("userid"));
    if (!
victim || !IsPlayerTank(victim)) return;
    
    
PrintTankDamageStatus(victim);
}

//This part was modified from > https://forums.alliedmods.net/showthread.php?p=2559282
void PrintTankDamageStatus(int victim)
{
    
int iSurvivoriPlayer[MAXPLAYERS+1][2];
    for (
int i 1<= MaxClientsi++)
    {
        if (
g_iPlayerTankDamage[i][victim] <= || !IsClientInGame(i) || GetClientTeam(i) != 2) continue;
        
iPlayer[iSurvivor][0] = i;
        
iPlayer[iSurvivor][1] = g_iPlayerTankDamage[i][victim];
        
iSurvivor++;
    }
    
    if (
iSurvivor == 0) return;
    
SortCustom2D(iPlayeriSurvivorSortDescending);

    
char sMessage[256];
    for (
int iiSurvivori++)
    {
        
int attacker iPlayer[i][0];
        
char sTemp[64];
        
        
Format(sTempsizeof(sTemp), "\x01%s \x05%N \x01(\x04%d \x01dmg)", (", " ""), attackerg_iPlayerTankDamage[attacker][victim]);
        
StrCat(sMessagesizeof(sMessage), sTemp);
        
g_iPlayerTankDamage[attacker][victim] = 0;
    }
    
    
PrintToChatAll("\x04[Notify] \x03%N \x01killed: %s\x01."victimsMessage);
}

int SortDescending(int[] elem1int[] elem2, const int[][] array, Handle hndl)
{
    return 
elem2[0] - elem1[0];
}

bool IsPlayerTank(int client)
{
    return (
IsClientInGame(client) && GetClientTeam(client) == && GetEntProp(clientProp_Send"m_zombieClass") == 8);
}

bool IsTankInDeathAnimation(int client)
{
    return (
GetEntProp(clientProp_Send"m_isIncapacitated"1) > || GetEntProp(clientProp_Send"m_nSequence") >= 65 || !IsPlayerAlive(client));
}

bool IsFireDamage(int damagetype)
{
    return (
damagetype == DMG_BURN || damagetype == DMG_PREVENT_PHYSICS_FORCE DMG_BURN || damagetype == DMG_DIRECT DMG_BURN);

__________________

Last edited by alasfourom; 06-07-2023 at 16:28.
alasfourom is offline
Mika Misori
Senior Member
Join Date: Sep 2022
Old 06-06-2023 , 15:54   Re: Tank Damage Announce by griffin
Reply With Quote #37

Quote:
Originally Posted by alasfourom View Post
Untested
Thank you so much! This is exactly what was missing and it works like a charm!
Mika Misori is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode