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

Display previous round information in chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
theuser
Member
Join Date: Jul 2020
Old 07-25-2021 , 08:32   Display previous round information in chat
Reply With Quote #1

Hi
How to enable the ability to show in each round who we shot in the previous round or who shot us in the server?
Similar to the photo below

Last edited by theuser; 08-14-2021 at 01:11.
theuser is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-25-2021 , 20:07   Re: Display previous round information in chat
Reply With Quote #2

Just need to tweak it to chat print instead of show a HUD.

https://forums.alliedmods.net/showpo...33&postcount=9
__________________
Bugsy is offline
theuser
Member
Join Date: Jul 2020
Old 07-26-2021 , 11:11   Re: Display previous round information in chat
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
Just need to tweak it to chat print instead of show a HUD.

https://forums.alliedmods.net/showpo...33&postcount=9
There are several drawbacks
Does not show damage correctly
And that I want to write is taken with a few shots and the text is exactly the same as the photo
Can you do this for me?
theuser is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-26-2021 , 11:56   Re: Display previous round information in chat
Reply With Quote #4

Yes, that can be done, give me a day or 2.

What do you mean by the damage isn't accurate? Is this because you see it go over 100? If so, I can clamp it at that.

Is this supposed to show all enemy players with damage given/taken, or only if the value is > 0 on either given or taken?
__________________

Last edited by Bugsy; 07-26-2021 at 11:57.
Bugsy is offline
theuser
Member
Join Date: Jul 2020
Old 07-27-2021 , 03:09   Re: Display previous round information in chat
Reply With Quote #5

Quote:
Originally Posted by Bugsy View Post
Yes, that can be done, give me a day or 2.

What do you mean by the damage isn't accurate? Is this because you see it go over 100? If so, I can clamp it at that.

Is this supposed to show all enemy players with damage given/taken, or only if the value is > 0 on either given or taken?
Yes, sometimes it is more than 100, which I want to be a maximum of 100.
And that sometimes it is not displayed correctly
For example, I do 100 damage and the plugin writes 80
thank you
theuser is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-27-2021 , 22:29   Re: Display previous round information in chat
Reply With Quote #6

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_pzStatsMAX_PLAYERS ][ MAX_PLAYERS ][ PlayerStats ];

public 
plugin_init() 
{
    
register_plugin"Round Damage" Version "bugsy" );
    
    
RegisterHamHam_TakeDamage "player" "HamTakeDamage" true );
    
register_logevent"RoundEnd" "1=Round_End" ); 
}

public 
HamTakeDamagevictim inflictor attacker Float:fDamage bitDamage 
{     
    new 
iActualDamage pevvictim pev_dmg_take ); 
    
    
g_pzStatsattacker ][ victim ][ Shots ]++;
    
g_pzStatsvictim ][ attacker ][ DamageReceived ] += iActualDamage;
    
g_pzStatsattacker ][ victim ][ DamageGiven ] += iActualDamage;
}

public 
RoundEnd()
{
    new 
iPlayers32 ] , iNum iAttackerPlayer iVictimPlayer iDamageGiven iDamageTaken iHealthMAX_PLAYERS ] , szNameMAX_PLAYERS ][ 32 ];
    
    
get_playersiPlayers iNum );
    
    for ( new 
iNum i++ )
    {
        
iAttackerPlayer iPlayers];
        
        for ( new 
iNum p++ )
        {
            
iVictimPlayer iPlayers];
            
            if ( ( 
!= ) && g_pzStatsiAttackerPlayer ][ iVictimPlayer ][ DamageGiven ] || g_pzStatsiAttackerPlayer ][ iVictimPlayer ][ DamageReceived ] )
            {
                
iDamageGiven ming_pzStatsiAttackerPlayer ][ iVictimPlayer ][ DamageGiven ] , 100 );
                
iDamageTaken ming_pzStatsiAttackerPlayer ][ iVictimPlayer ][ DamageReceived ] , 100 );
            
                if ( 
iDamageGiven || iDamageTaken )
                {
                    if ( !
iHealthiVictimPlayer ] )
                        
iHealthiVictimPlayer ] = is_user_aliveiVictimPlayer ) ? get_user_healthiVictimPlayer ) : 0;
                        
                    if ( 
szNameiVictimPlayer ][ ] == EOS )
                        
get_user_nameiVictimPlayer szNameiVictimPlayer ] , charsmaxszName[] ) );
                        
                    
client_printiAttackerPlayer print_chat "(%d with %d) damage, (%d with %d) taken, %s (%dHP)" iDamageGiven g_pzStatsiAttackerPlayer ][ iVictimPlayer ][ Shots ] , iDamageTaken g_pzStatsiVictimPlayer ][ iAttackerPlayer ][ Shots ] , szNameiVictimPlayer ] , iHealthiVictimPlayer ] );
                }
            }
        }
    }

    
ClearArray();
}

ClearArray()
{
    for ( new 
<= MAX_PLAYERS i++ )
    {
        for ( new 
<= MAX_PLAYERS p++ )
        {
            
g_pzStats][ ][ Shots ] = 0;
            
g_pzStats][ ][ DamageGiven ] = 0;
            
g_pzStats][ ][ DamageReceived ] = 0;
        }
    }

__________________

Last edited by Bugsy; 07-27-2021 at 22:31.
Bugsy is offline
theuser
Member
Join Date: Jul 2020
Old 07-28-2021 , 06:50   Re: Display previous round information in chat
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
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_pzStatsMAX_PLAYERS ][ MAX_PLAYERS ][ PlayerStats ];

public 
plugin_init() 
{
    
register_plugin"Round Damage" Version "bugsy" );
    
    
RegisterHamHam_TakeDamage "player" "HamTakeDamage" true );
    
register_logevent"RoundEnd" "1=Round_End" ); 
}

public 
HamTakeDamagevictim inflictor attacker Float:fDamage bitDamage 
{     
    new 
iActualDamage pevvictim pev_dmg_take ); 
    
    
g_pzStatsattacker ][ victim ][ Shots ]++;
    
g_pzStatsvictim ][ attacker ][ DamageReceived ] += iActualDamage;
    
g_pzStatsattacker ][ victim ][ DamageGiven ] += iActualDamage;
}

public 
RoundEnd()
{
    new 
iPlayers32 ] , iNum iAttackerPlayer iVictimPlayer iDamageGiven iDamageTaken iHealthMAX_PLAYERS ] , szNameMAX_PLAYERS ][ 32 ];
    
    
get_playersiPlayers iNum );
    
    for ( new 
iNum i++ )
    {
        
iAttackerPlayer iPlayers];
        
        for ( new 
iNum p++ )
        {
            
iVictimPlayer iPlayers];
            
            if ( ( 
!= ) && g_pzStatsiAttackerPlayer ][ iVictimPlayer ][ DamageGiven ] || g_pzStatsiAttackerPlayer ][ iVictimPlayer ][ DamageReceived ] )
            {
                
iDamageGiven ming_pzStatsiAttackerPlayer ][ iVictimPlayer ][ DamageGiven ] , 100 );
                
iDamageTaken ming_pzStatsiAttackerPlayer ][ iVictimPlayer ][ DamageReceived ] , 100 );
            
                if ( 
iDamageGiven || iDamageTaken )
                {
                    if ( !
iHealthiVictimPlayer ] )
                        
iHealthiVictimPlayer ] = is_user_aliveiVictimPlayer ) ? get_user_healthiVictimPlayer ) : 0;
                        
                    if ( 
szNameiVictimPlayer ][ ] == EOS )
                        
get_user_nameiVictimPlayer szNameiVictimPlayer ] , charsmaxszName[] ) );
                        
                    
client_printiAttackerPlayer print_chat "(%d with %d) damage, (%d with %d) taken, %s (%dHP)" iDamageGiven g_pzStatsiAttackerPlayer ][ iVictimPlayer ][ Shots ] , iDamageTaken g_pzStatsiVictimPlayer ][ iAttackerPlayer ][ Shots ] , szNameiVictimPlayer ] , iHealthiVictimPlayer ] );
                }
            }
        }
    }

    
ClearArray();
}

ClearArray()
{
    for ( new 
<= MAX_PLAYERS i++ )
    {
        for ( new 
<= MAX_PLAYERS p++ )
        {
            
g_pzStats][ ][ Shots ] = 0;
            
g_pzStats][ ][ DamageGiven ] = 0;
            
g_pzStats][ ][ 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: س
theuser is offline
theuser
Member
Join Date: Jul 2020
Old 08-07-2021 , 00:59   Re: Display previous round information in chat
Reply With Quote #8

theuser is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-07-2021 , 21:04   Re: Display previous round information in chat
Reply With Quote #9

1. Yes, it's possible
2. If either player issued damage, it should show
__________________
Bugsy is offline
theuser
Member
Join Date: Jul 2020
Old 08-08-2021 , 03:52   Re: Display previous round information in chat
Reply With Quote #10

Quote:
Originally Posted by Bugsy View Post
1. Yes, it's possible
2. If either player issued damage, it should show
can you edit for me please?
theuser is offline
Reply



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 20:33.


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