 |
|
Member
|

07-28-2021
, 06:50
Re: Display previous round information in chat
|
#7
|
Quote:
Originally Posted by Bugsy
Try this
PHP Code:
#include <amxmodx> #include <hamsandwich> #include <fakemeta>
new const Version[] = "0.1";
#define MAX_PLAYERS 32 #define MAX_NAME_LENGTH 32
enum PlayerStats { Shots, DamageGiven, DamageReceived }
new g_pzStats[ MAX_PLAYERS + 1 ][ MAX_PLAYERS + 1 ][ PlayerStats ];
public plugin_init() { register_plugin( "Round Damage" , Version , "bugsy" ); RegisterHam( Ham_TakeDamage , "player" , "HamTakeDamage" , true ); register_logevent( "RoundEnd" , 2 , "1=Round_End" ); }
public HamTakeDamage( victim , inflictor , attacker , Float:fDamage , bitDamage ) { new iActualDamage = pev( victim , pev_dmg_take ); g_pzStats[ attacker ][ victim ][ Shots ]++; g_pzStats[ victim ][ attacker ][ DamageReceived ] += iActualDamage; g_pzStats[ attacker ][ victim ][ DamageGiven ] += iActualDamage; }
public RoundEnd() { new iPlayers[ 32 ] , iNum , iAttackerPlayer , iVictimPlayer , iDamageGiven , iDamageTaken , iHealth[ MAX_PLAYERS + 1 ] , szName[ MAX_PLAYERS + 1 ][ 32 ]; get_players( iPlayers , iNum ); for ( new i = 0 ; i < iNum ; i++ ) { iAttackerPlayer = iPlayers[ i ]; for ( new p = 0 ; p < iNum ; p++ ) { iVictimPlayer = iPlayers[ p ]; if ( ( i != p ) && g_pzStats[ iAttackerPlayer ][ iVictimPlayer ][ DamageGiven ] || g_pzStats[ iAttackerPlayer ][ iVictimPlayer ][ DamageReceived ] ) { iDamageGiven = min( g_pzStats[ iAttackerPlayer ][ iVictimPlayer ][ DamageGiven ] , 100 ); iDamageTaken = min( g_pzStats[ iAttackerPlayer ][ iVictimPlayer ][ DamageReceived ] , 100 ); if ( iDamageGiven || iDamageTaken ) { if ( !iHealth[ iVictimPlayer ] ) iHealth[ iVictimPlayer ] = is_user_alive( iVictimPlayer ) ? get_user_health( iVictimPlayer ) : 0; if ( szName[ iVictimPlayer ][ 0 ] == EOS ) get_user_name( iVictimPlayer , szName[ iVictimPlayer ] , charsmax( szName[] ) ); client_print( iAttackerPlayer , print_chat , "(%d with %d) damage, (%d with %d) taken, %s (%dHP)" , iDamageGiven , g_pzStats[ iAttackerPlayer ][ iVictimPlayer ][ Shots ] , iDamageTaken , g_pzStats[ iVictimPlayer ][ iAttackerPlayer ][ Shots ] , szName[ iVictimPlayer ] , iHealth[ iVictimPlayer ] ); } } } }
ClearArray(); }
ClearArray() { for ( new i = 1 ; i <= MAX_PLAYERS ; i++ ) { for ( new p = 1 ; p <= MAX_PLAYERS ; p++ ) { g_pzStats[ i ][ p ][ Shots ] = 0; g_pzStats[ i ][ p ][ DamageGiven ] = 0; g_pzStats[ i ][ p ][ DamageReceived ] = 0; } } }
|
And is it possible to put a command to activate and deactivate this message?
And that if I did not damage the player but he damaged me, will this plugin show?
And that the plugin does not work properly!
Does not show the damage properly.
I deal 100 damage to the opponent, for example, he writes 68
And the damage done with greenade does not count
Last edited by theuser; 07-28-2021 at 15:21.
Reason: س
|
|
|
|